Cache lock refresh() for long-running operations #52778
Unanswered
justinas55
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
It would be nice to have a refresh() method on Cache lock instance, that would refresh lock TTL without releasing the lock. This would allow safe long-running operations without compromising with excessive TTL.
As an example such feature is implemented and documented in Symfony: https://symfony.com/doc/current/components/lock.html#expiring-locks .
Currently the closest workaround I found is this:
Having ->refresh(), same code could be simplified and made reliable:
Haven't found related issues, curious if this has been considered, is there known limitations to implementing this? Should be possible with Redis, probably utilizing transactions, but not sure about the other stores.
Thanks for checking!
Beta Was this translation helpful? Give feedback.
All reactions