Skip to content

Commit 0f8ef27

Browse files
committed
Update now
1 parent ae94a39 commit 0f8ef27

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

docs/constraints/workflow-constraints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The determinism constraints for workflow classes dictate that a workflow class m
88

99
Here are some examples of things you shouldn't do inside of a workflow class:
1010

11-
- Don't use the `Carbon::now()` method to get the current date and time, as this will produce different results each time it is called. Instead, use the `WorkflowStub::now()` method, which returns a fixed date and time.
11+
- Don't use the `Carbon::now()` method to get the current date and time, as this will produce different results each time it is called. Instead, use the `Workflow\now()` method, which returns a fixed date and time.
1212
- Don't use the `Auth::user()` method to get the current user, as this will produce different results depending on who is currently logged in. Instead, pass the user as an input to the workflow when it is started.
1313
- Don't make network requests to external resources, as these may be slow or unavailable at different times. Instead, pass the necessary data as inputs to the workflow when it is started or use an activity to retrieve the data.
1414
- Don't use random number generators (unless using a side effect) or other sources of randomness, as these will produce different results each time they are called. Instead, pass any necessary randomness as an input to the workflow when it is started.

docs/features/timers.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ You may also specify the time to wait as a string e.g. '5 seconds', '30 minutes'
3131

3232
**Important:** Inside of a workflow, never use `Carbon::now()` or Laravel's `now()` to get the current time. Instead, use `Workflow\now()`, which returns the current time as seen by the workflow system. This is crucial because the actual time may not match your application's system clock.
3333

34-
```php
35-
use function Workflow\now;
36-
```
37-
3834
Additionally, when measuring elapsed time in workflows (e.g., tracking how long an activity takes), always get your start and end times with:
3935

4036
```php

0 commit comments

Comments
 (0)