lib/outboxable/polling_publisher_worker.rb in outboxable-0.1.4 vs lib/outboxable/polling_publisher_worker.rb in outboxable-0.1.5
- old
+ new
@@ -5,11 +5,11 @@
def perform
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
end
end