Sha256: 557fd343a72e0f5de2e52ebb2e543f105bd2a4fa342de22d55dbdc4cd8cd8141
Contents?: true
Size: 786 Bytes
Versions: 8
Compression:
Stored size: 786 Bytes
Contents
begin require 'delayed_job' rescue LoadError end # Based on the Sentry equivalent. if defined?(Delayed) module Delayed module Plugins class Opbeat < ::Delayed::Plugin callbacks do |lifecycle| lifecycle.around(:invoke_job) do |job, *args, &block| begin # Forward the call to the next callback in the callback chain block.call(job, *args) rescue Exception => exception # Log error to Opbeat ::Opbeat.capture_exception(exception) # Make sure we propagate the failure! raise exception end end end end end end # Register DelayedJob Opbeat plugin Delayed::Worker.plugins << Delayed::Plugins::Opbeat end
Version data entries
8 entries across 8 versions & 2 rubygems