mirror of
https://github.com/ditkrg/outboxable.git
synced 2026-01-22 22:06:47 +00:00
Adds transitionary state
This commit is contained in:
parent
aaf2f57d06
commit
286d11984b
@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
outboxable (0.1.4)
|
||||
outboxable (0.1.5)
|
||||
bunny (>= 2.19.0)
|
||||
connection_pool (~> 2.3.0)
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ module Outboxable
|
||||
Outbox.pending.where(last_attempted_at: [..Time.zone.now, nil]).find_in_batches(batch_size: 100).each do |batch|
|
||||
batch.each do |outbox|
|
||||
# This is to prevent a job from being retried too many times. Worst-case scenario is 1 minute delay in jobs.
|
||||
outbox.update(last_attempted_at: 1.minute.from_now)
|
||||
Outboxable::Worker.perform_async(outbox.id)
|
||||
outbox.update(last_attempted_at: 1.minute.from_now, status: :processing)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Outboxable
|
||||
VERSION = '0.1.4'
|
||||
VERSION = '0.1.5'
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user