Skip to content

Commit 39d0853

Browse files
committed
update example
1 parent 8a845ba commit 39d0853

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ Atomic locks allow for the manipulation of distributed locks without worrying ab
334334

335335
The `get` method also accepts a closure. After the closure is executed, Laravel will automatically release the lock:
336336

337-
Cache::lock('foo')->get(function () {
338-
// Lock acquired indefinitely and automatically released...
337+
Cache::lock('foo', 10)->get(function () {
338+
// Lock acquired for 10 seconds and automatically released...
339339
});
340340

341341
If the lock is not available at the moment you request it, you may instruct Laravel to wait for a specified number of seconds. If the lock can not be acquired within the specified time limit, an `Illuminate\Contracts\Cache\LockTimeoutException` will be thrown:

0 commit comments

Comments
 (0)