Sha256: 2f3efa3ab38d516b8f30fb51f1d796f918bcde57a4ecf16bd59d4ee106a03de7
Contents?: true
Size: 378 Bytes
Versions: 15
Compression:
Stored size: 378 Bytes
Contents
def lock was_already_locked = locked? return if was_already_locked Card::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
15 entries across 15 versions & 1 rubygems