Class: AtomicSidekiq::AtomicOperation::Expire
- Defined in:
- lib/atomic_sidekiq/atomic_operation/expire.rb
Constant Summary collapse
- EXPIRE_SCRIPT =
File.read( File.join(File.dirname(__FILE__), "./lua_scripts/expire.lua") )
Instance Method Summary collapse
-
#initialize ⇒ Expire
constructor
A new instance of Expire.
- #perform(queue, in_flight_key) ⇒ Object
Constructor Details
#initialize ⇒ Expire
Returns a new instance of Expire.
9 10 11 |
# File 'lib/atomic_sidekiq/atomic_operation/expire.rb', line 9 def initialize super(in_flight_keymaker: nil) end |
Instance Method Details
#perform(queue, in_flight_key) ⇒ Object
13 14 15 16 17 |
# File 'lib/atomic_sidekiq/atomic_operation/expire.rb', line 13 def perform(queue, in_flight_key) redis do |conn| conn.eval(EXPIRE_SCRIPT, [queue, in_flight_key], [Time.now.utc.to_i]) end end |