Sha256: dcf4761df58a8c96257c4bad4b0af8c04afa7001860c4020e143ad2e91709827
Contents?: true
Size: 671 Bytes
Versions: 9
Compression:
Stored size: 671 Bytes
Contents
require 'time' require 'sidekiq' module Raven class Sidekiq def call(_worker, msg, _queue) started_at = Time.now yield rescue Exception => ex Raven.capture_exception(ex, :extra => { :sidekiq => msg }, :time_spent => Time.now-started_at) raise end end end if Sidekiq::VERSION < '3' # old behavior ::Sidekiq.configure_server do |config| config.server_middleware do |chain| chain.add ::Raven::Sidekiq end end else Sidekiq.configure_server do |config| config.error_handlers << Proc.new {|ex,context| Raven.capture_exception(ex, :extra => {:sidekiq => context}) } end end
Version data entries
9 entries across 9 versions & 1 rubygems