Class: CanvasSync::JobUniqueness::Strategy::UntilExecuted

Inherits:
Base
  • Object
show all
Defined in:
lib/canvas_sync/job_uniqueness/strategy/until_executed.rb

Direct Known Subclasses

UntilExpired

Instance Attribute Summary

Attributes inherited from Base

#lock_context

Instance Method Summary collapse

Methods inherited from Base

#batch_callback, #initialize, locks_on

Constructor Details

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

Instance Method Details

#on_enqueueObject



6
7
8
9
10
11
12
# File 'lib/canvas_sync/job_uniqueness/strategy/until_executed.rb', line 6

def on_enqueue
  lock!(:enqueue)

  wrap_in_batch do
    yield
  end
end

#on_performObject



14
15
16
17
# File 'lib/canvas_sync/job_uniqueness/strategy/until_executed.rb', line 14

def on_perform
  lock!(:perform)
  yield
end