You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing a simple lock interface on Rails.cache
& currently using Rails.cache.fetch(lock_key, expires_in: timeout) { lock_value } == lock_value
But it is not atomic as it makes multiple SQL queries
Can we implement support for Rails.cache.write(lock_key, lock_value, unless_exist: true, expires_in: timeout)
The text was updated successfully, but these errors were encountered:
@skatkov - I've had to rework the PR to handle expired entries, which had the side effect of removing the dependency on Rails 7.2+ so we'll be able to merge that now.
I am implementing a simple lock interface on Rails.cache
& currently using
Rails.cache.fetch(lock_key, expires_in: timeout) { lock_value } == lock_value
But it is not atomic as it makes multiple SQL queries
Can we implement support for
Rails.cache.write(lock_key, lock_value, unless_exist: true, expires_in: timeout)
The text was updated successfully, but these errors were encountered: