Module: Resque::Plugins::UniqueJob::ClassMethods
- Defined in:
- lib/resque_solo/unique_job.rb
Instance Method Summary collapse
-
#lock_after_execution_period ⇒ Object
The default ttl of a persisting key is 0, i.e.
-
#redis_key(payload) ⇒ Object
Payload is what Resque stored for this job along with the job’s class name: a hash containing :class and :args.
-
#ttl ⇒ Object
The default ttl of a locking key is -1 (forever).
Instance Method Details
#lock_after_execution_period ⇒ Object
47 48 49 |
# File 'lib/resque_solo/unique_job.rb', line 47 def lock_after_execution_period @lock_after_execution_period ||= 0 end |
#redis_key(payload) ⇒ Object
Payload is what Resque stored for this job along with the job’s class name: a hash containing :class and :args
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/resque_solo/unique_job.rb', line 15 def redis_key(payload) payload = Resque.decode(Resque.encode(payload)) job = payload["class"] args = payload["args"] args.map! do |arg| arg.is_a?(Hash) ? arg.sort : arg end Digest::MD5.hexdigest Resque.encode(class: job, args: args) end |