Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker is dead term #229

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ def within_sidekiq_retries_exhausted_block(user_msg = {}, exception = default_re

def default_retries_exhausted_message
{
'queue' => get_sidekiq_options[:worker],
'queue' => get_sidekiq_options['queue'],
'class' => name,
'args' => [],
'error_message' => 'An error occured'
'error_message' => 'An error occurred'
}
end

def default_retries_exhausted_exception
StandardError.new('An error occured')
StandardError.new('An error occurred')
end
end
end
Expand Down
9 changes: 9 additions & 0 deletions spec/rspec/sidekiq/helpers/retries_exhausted_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ def self.baz(exception)
end
end

it 'has an exhausted message' do
expect(FooClass.default_retries_exhausted_message).to eq({
"args" => [],
"class" => "FooClass",
"error_message" => "An error occurred",
"queue" => "data",
})
end

it 'executes whatever is within the block' do
FooClass.within_sidekiq_retries_exhausted_block { expect(FooClass).to receive(:bar).with('hello') }
end
Expand Down