Sha256: c666e62548850631a24e677f3f65689abcc78182f6efa52dbfb284c9fb8ff735
Contents?: true
Size: 650 Bytes
Versions: 11
Compression:
Stored size: 650 Bytes
Contents
require 'sidekiq' module Rollbar module Delay class Sidekiq OPTIONS = { 'queue' => 'rollbar', 'class' => Rollbar::Delay::Sidekiq }.freeze def initialize(*args) @options = (opts = args.shift) ? OPTIONS.merge(opts) : OPTIONS end def call(payload) return unless ::Sidekiq::Client.push(@options.merge('args' => [payload])).nil? raise(StandardError, 'Unable to push the job to Sidekiq') end include ::Sidekiq::Worker def perform(*args) Rollbar.process_from_async_handler(*args) # Do not rescue. Sidekiq will call the error handler. end end end end
Version data entries
11 entries across 11 versions & 1 rubygems