Sha256: ff7d68bdb6c1a5512d5481303b147b15e9571ac9abe1eaf1679eecd2c525f8aa
Contents?: true
Size: 614 Bytes
Versions: 1
Compression:
Stored size: 614 Bytes
Contents
# frozen_string_literal: true module SidekiqUniqueJobs module Unlockable module_function def unlock(item) unlock_by_key(item[UNIQUE_DIGEST_KEY], item[JID_KEY]) end def unlock_by_key(unique_key, jid, redis_pool = nil) return false unless Scripts::ReleaseLock.execute(redis_pool, unique_key, jid) after_unlock(jid) end def after_unlock(jid) ensure_job_id_removed(jid) end def ensure_job_id_removed(jid) Sidekiq.redis { |redis| redis.hdel(SidekiqUniqueJobs::HASH_KEY, jid) } end def logger SidekiqUniqueJobs.logger end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sidekiq-unique-jobs-5.0.4 | lib/sidekiq_unique_jobs/unlockable.rb |