Skip to content

Commit b489ae5

Browse files
boseruptaylorotwell
andauthoredMar 22, 2025
[12.x] Add schedule useCache example (#10273)
* Add schedule useCache example * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 3a30b3d commit b489ae5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎scheduling.md

+9
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,15 @@ Schedule::command('report:generate')
362362
->onOneServer();
363363
```
364364

365+
You may use the `useCache` method to customize the cache store used by the scheduler to obtain the atomic locks necessary for single-server tasks:
366+
367+
```php
368+
Schedule::command('recipes:sync')
369+
->everyThirtyMinutes()
370+
->onOneServer();
371+
->useCache('database');
372+
```
373+
365374
<a name="naming-unique-jobs"></a>
366375
#### Naming Single Server Jobs
367376

0 commit comments

Comments
 (0)
Please sign in to comment.