Sha256: 44275c4576f64ac2518c01f3b5ba055b796ac32a9dcfaf3d0293986423a4bc9d

Contents?: true

Size: 479 Bytes

Versions: 10

Compression:

Stored size: 479 Bytes

Contents

module CanvasSync::JobUniqueness
  module OnConflict
    class Reschedule < OnConflict::Base
      valid_for :perform

      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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
canvas_sync-0.22.9 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.8 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.6 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.5 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.4 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.3 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.2 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.1 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.0 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb
canvas_sync-0.22.0.beta8 lib/canvas_sync/job_uniqueness/on_conflict/reschedule.rb