lib/atomic_sidekiq/atomic_operation/expire.rb in atomic-sidekiq-1.1.4 vs lib/atomic_sidekiq/atomic_operation/expire.rb in atomic-sidekiq-1.2.0
- old
+ new
@@ -8,12 +8,22 @@
def initialize
super(in_flight_keymaker: nil)
end
- def perform(queue, in_flight_key)
+ def perform(queue, in_flight_key, recover:)
redis do |conn|
- conn.eval(EXPIRE_SCRIPT, [queue, in_flight_key], [Time.now.utc.to_i])
+ conn.eval(
+ EXPIRE_SCRIPT,
+ [
+ queue, # Queue Name
+ in_flight_key, # Key of the inflight job being expired
+ ],
+ [
+ Time.now.utc.to_i, # Current time
+ recover, # Boolean flag: should it be recovered if expired
+ ]
+ )
end
end
end
end
end