mirror of
https://github.com/ditkrg/outboxable.git
synced 2026-01-22 13:56:49 +00:00
Adds initial 10 seconds as last_attempted_at so that it is not picked again by polling publisher
This commit is contained in:
parent
02bd4dcc00
commit
cf5f49691f
@ -10,15 +10,13 @@ class Outbox < ApplicationRecord
|
||||
enum size: { single: 0, batch: 1 }
|
||||
|
||||
# Validations
|
||||
validates :payload, presence: true
|
||||
validates :exchange, presence: true
|
||||
validates :routing_key, presence: true
|
||||
validates :payload, :exchange, :routing_key, presence: true
|
||||
|
||||
# Associations
|
||||
belongs_to :outboxable, polymorphic: true, optional: true
|
||||
|
||||
def set_last_attempted_at
|
||||
self.last_attempted_at = Time.zone.now
|
||||
self.last_attempted_at = 10.seconds.from_now
|
||||
end
|
||||
|
||||
def publish
|
||||
|
||||
Loading…
Reference in New Issue
Block a user