Sha256: 1db568ced29dbbf0642334e2d015efa0ae5ff6d97a1e7f013d923bed80dde6c7
Contents?: true
Size: 371 Bytes
Versions: 53
Compression:
Stored size: 371 Bytes
Contents
def lock was_already_locked = locked? return if was_already_locked Auth.as_bot do lock! yield end ensure unlock! unless was_already_locked end def lock_cache_key "UPDATE-LOCK:#{key}" end def locked? Card.cache.read lock_cache_key end def lock! Card.cache.write lock_cache_key, true end def unlock! Card.cache.write lock_cache_key, false end
Version data entries
53 entries across 53 versions & 2 rubygems