Class: ActiveJob::Uniqueness::Strategies::UntilExecuting

Inherits:
Base
  • Object
show all
Includes:
LockingOnEnqueue
Defined in:
lib/active_job/uniqueness/strategies/until_executing.rb

Overview

Locks the job when it is pushed to the queue. Unlocks the job before the job is started.

Constant Summary

Constants inherited from Base

Base::ACTIVEJOB_SUPPORTS_THROW_ABORT

Instance Attribute Summary

Attributes inherited from Base

#job, #lock_key, #lock_ttl, #on_conflict, #on_redis_connection_error

Instance Method Summary collapse

Methods inherited from Base

#after_perform, #around_enqueue, #around_perform, #before_enqueue, #initialize, #lock, #unlock

Constructor Details

This class inherits a constructor from ActiveJob::Uniqueness::Strategies::Base

Instance Method Details

#before_performObject



11
12
13
# File 'lib/active_job/uniqueness/strategies/until_executing.rb', line 11

def before_perform
  unlock(resource: lock_key)
end