Skip to content

Commit

Permalink
Fix deprecation for Sidekiq 8.0 error handler
Browse files Browse the repository at this point in the history
Sidekiq 7.1.5 introduces a change where the Sidekiq config is not
passed in the context hash anymore, but as a separate positional
argument.

If the handler takes two arguments a deprecation warning is logged.
In 8.0 this backwards compatibility will be dropped.

Since the config is not used at all, we can simply add an optional
3rd argument that works with old and new versions.

Co-authored-by: Bart de Water <118401830+bdewater-thatch@users.noreply.github.com>
  • Loading branch information
bdewater-thatch authored and unflxw committed Oct 30, 2023
1 parent 40a1520 commit c8698dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changesets/fix-deprecation-warning-for-sidekiq-7-1-6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "fix"
---

Fix a deprecation warning for Sidekiq 7.1.6+ when an error is reported to AppSignal. (Thanks @bdewater-thatch!)
2 changes: 1 addition & 1 deletion lib/appsignal/integrations/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Integrations
#
# @api private
class SidekiqErrorHandler
def call(exception, sidekiq_context)
def call(exception, sidekiq_context, _sidekiq_config = nil)
transaction =
if Appsignal::Transaction.current?
Appsignal::Transaction.current
Expand Down

0 comments on commit c8698dc

Please sign in to comment.