sidekiq-sequence
sidekiq-sequence copied to clipboard
Sequences not being processes 100% of the time.
I have a sequence with 2 steps that is not running.
class Events::ResetRecurrencesSequence < Sidekiq::Sequence::Base
step DestroyRecurrences
step CreateRecurrences
end
# app/jobs/events/reset_recurrences_sequence/destroy_recurrences.rb
class Events::DestroyEventSequence::DestroyRecurrences
include Sidekiq::Sequence::Worker
def perform
event_id = @data.dig(:event_id)
Events::DestroyRecurrencesJob.perform_now(event_id)
end
end
# app/jobs/events/reset_recurrences_sequence/create_recurrences.rb
class Events::ResetRecurrencesSequence::CreateRecurrences
include Sidekiq::Sequence::Worker
def perform
event_id = @data.dig(:event_id)
Events::CreateRecurrencesJob.perform_now(event_id)
end
end
I am initializing the sequence like so:
Events::ResetRecurrencesSequence.new(event_id: event.id)
I see the sequence record in the sidekiq_sequence_records
table and the current_step
is set to 0. The strange thing is it works intermittentedly.
@joelmoss Any thoughts here?
Hmm, can you please create a bare rails app that reproduces this, and put it in a public GH repo? thx