Module: Sidekiq::Sequence::Perform

Defined in:
lib/sidekiq/sequence/perform.rb

Instance Method Summary collapse

Instance Method Details

#perform(id, *args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/sidekiq/sequence/perform.rb', line 6

def perform(id, *args)
  @record = Record.find(id)
  @data = @record.data.with_indifferent_access

  super(*args)

  # Increment the step and update data attribute.
  @record.increment(:current_step)
  @record.data = @data
  @record.save!

  # Perform the next in sequence.
  self.class.parent.perform_step @record.current_step, @record.id
end