Class: CanvasSync::JobUniqueness::OnConflict::Reschedule

Inherits:
Base
  • Object
show all
Defined in:
lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb

Instance Attribute Summary

Attributes inherited from Base

#lock_context, #redis_pool

Instance Method Summary collapse

Methods inherited from Base

#initialize, #replace?, valid_for

Constructor Details

This class inherits a constructor from CanvasSync::JobUniqueness::OnConflict::Base

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
# File 'lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb', line 6

def call
  Thread.current[:unique_jobs_previous_context] = lock_context
  rescheduled = lock_context.reenqueue(
    schedule_in: schedule_in,
  )
ensure
  Thread.current[:unique_jobs_previous_context] = nil
end

#schedule_inObject



15
16
17
# File 'lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb', line 15

def schedule_in
  lock_context.config[:reschedule_in] || 60
end