sidekiq-sequence icon indicating copy to clipboard operation
sidekiq-sequence copied to clipboard

Sequences not being processes 100% of the time.

Open t2 opened this issue 2 years ago • 2 comments

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.

t2 avatar Jan 12 '23 16:01 t2

@joelmoss Any thoughts here?

t2 avatar Jun 07 '23 20:06 t2

Hmm, can you please create a bare rails app that reproduces this, and put it in a public GH repo? thx

joelmoss avatar Jun 08 '23 12:06 joelmoss