mikaeledstrom's avatar

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;

  1. maximum lock duration, e.g. 20 here "\Cache::lock('foo', 20)"
  2. 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?

0 likes
0 replies

Please or to participate in this conversation.