Class: CanvasSync::JobUniqueness::Strategy::WhileExecuting

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

Constant Summary collapse

RUN_SUFFIX =
":RUN"

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



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

def on_enqueue
  wrap_in_batch do
    yield
  end
end

#on_performObject



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

def on_perform
  lock!(:perform)
  yield
end