Skip to content

Commit

Permalink
Fix serialization of ZyncWorker arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mayorova committed Nov 8, 2023
1 parent 30a647c commit ac16191
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/workers/zync_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def on_complete(_bid, options)
# The number of retries is usually controlled at the origin of the failure using ThreeScale::SidekiqRetrySupport::Worker#last_attempt?,
# but in this case we are not really using Sidekiq retries, but rather re-enqueueing the job manually here
manual_retry_count = options['manual_retry_count'].to_i + 1
perform_async(event.event_id, event.data.to_json, manual_retry_count)
perform_async(event.event_id, event.data.as_json, manual_retry_count)
end

delegate :perform_async, to: :class
Expand Down
2 changes: 1 addition & 1 deletion test/workers/zync_worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class UnprocessableEntityRetryTest < ActiveSupport::TestCase
test 'on batch complete' do
event_id = event.event_id
klass = worker.class
klass.expects(:perform_async).with(event_id, anything, 1)
klass.expects(:perform_async).with(event_id, event.data.as_json, 1)
klass.new.on_complete(1, {'event_id' => event_id, 'manual_retry_count' => 0})
end

Expand Down

0 comments on commit ac16191

Please sign in to comment.