Class: SidekiqRobustJob::EnqueueConflictResolutionStrategy::DropSelf

Inherits:
Base
  • Object
show all
Defined in:
lib/sidekiq_robust_job/enqueue_conflict_resolution_strategy/drop_self.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#execute(job) ⇒ Object



4
5
6
7
8
# File 'lib/sidekiq_robust_job/enqueue_conflict_resolution_strategy/drop_self.rb', line 4

def execute(job)
  if jobs_repository.not_started_for_digest(job.digest, exclude_id: job.id).any?
    job.drop(dropped_by_job_id: job.id, clock: clock)
  end
end