Skip to content

Conversation

@jcalvert
Copy link

If you are creating semaphores dynamically, the keys do not naturally expire and will gradually build up in Redis. This assumes you don't have exceptionally long running critical sections as no expiration is set on the grabbed_key. In theory there could be some point within exists_or_create! where the exists_key expires between the getset and the renewal of the expiration, but this setting would be only appropriate when there is some definitive time the lock is no longer useful like a bidding window that has closed

@wbrady
Copy link

wbrady commented Oct 29, 2014

👍

…dynamically, the keys do not naturally expire and will gradually build up in Redis. This assumes you don't have exceptionally long running critical sections as no expiration is set on the grabbed_key. In theory there could be some point within exists_or_create! where the exists_key expires between the getset and the renewal of the expiration, but this setting would be only appropriate when there is some definitive time the lock is no longer useful like a bidding window that has closed
jcalvert added a commit that referenced this pull request Oct 29, 2014
Add support for an expiration option.
@jcalvert jcalvert merged commit f931734 into master Oct 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants