Class: SidekiqRobustJob::UniquenessStrategy::UntilExecuting

Inherits:
Base
  • Object
show all
Defined in:
lib/sidekiq_robust_job/uniqueness_strategy/until_executing.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from SidekiqRobustJob::UniquenessStrategy::Base

Instance Method Details

#execute(job) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/sidekiq_robust_job/uniqueness_strategy/until_executing.rb', line 4

def execute(job)
  lock(job) do |locked|
    if locked
      drop_unprocessed_jobs(job)
    else
      job.reschedule and return
    end
  end
  perform_job_and_finalize(job)
end