Class: ActiveJob::Uniqueness::Strategies::UntilExecuted

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

Overview

Locks the job when it is pushed to the queue. Unlocks the job when the job is finished.

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

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

Constructor Details

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

Instance Method Details

#after_performObject



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

def after_perform
  unlock(resource: lock_key)
end