Class: CanvasSync::JobUniqueness::Strategy::UntilExecuting

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

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
# File 'lib/canvas_sync/job_uniqueness/strategy/until_executing.rb', line 6

def on_enqueue
  lock!(:enqueue)
  yield
end

#on_performObject



11
12
13
14
# File 'lib/canvas_sync/job_uniqueness/strategy/until_executing.rb', line 11

def on_perform
  unlock
  yield
end