-
Notifications
You must be signed in to change notification settings - Fork 280
/
sidekiq.rb
37 lines (31 loc) · 1003 Bytes
/
sidekiq.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Rollbar.plugins.define('sidekiq >= 3') do
require_dependency('sidekiq')
dependency { !configuration.disable_monkey_patch }
dependency { defined?(Sidekiq) }
dependency { Sidekiq::VERSION.split('.')[0].to_i >= 3 }
execute do
require 'rollbar/plugins/sidekiq/plugin'
Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add Rollbar::Sidekiq::ResetScope
end
config.error_handlers << proc do |e, context, _sidekiq_config = nil|
Rollbar::Sidekiq.handle_exception(context, e)
end
end
end
end
Rollbar.plugins.define('sidekiq < 3') do
require_dependency('sidekiq')
dependency { !configuration.disable_monkey_patch }
dependency { defined?(Sidekiq) }
dependency { Sidekiq::VERSION.split('.')[0].to_i < 3 }
execute do
require 'rollbar/plugins/sidekiq/plugin'
Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add Rollbar::Sidekiq
end
end
end
end