Sep 6, 2023
0
Level 1
Best practice settings for atomic cache lock in Laravel?
I am trying to learn about atomic locks to prevent race conditions in our e-commerce Laravel app.
I believe there are these 2 possible numeric settings;
- maximum lock duration, e.g. 20 here "\Cache::lock('foo', 20)"
- block time when LockTimeoutException should occur, e.g. 10 here "->block(10"
Is there a considered best practice of 1) and 2) If you use it in your code, what settings do you have and what was the reasoning behind?
Please or to participate in this conversation.