Sha256: e7ddcd1ff8bd803a2ef883fdcf4a874986b280a4d1a0e869c26c39718a3b163b
Contents?: true
Size: 697 Bytes
Versions: 8
Compression:
Stored size: 697 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) raise StandardError, 'Unable to push the job to Sidekiq' if ::Sidekiq::Client.push(@options.merge('args' => [payload])).nil? end include ::Sidekiq::Worker def perform(*args) Rollbar.process_from_async_handler(*args) rescue StandardError # Raise the exception so Sidekiq can track the errored job # and retry it raise end end end end
Version data entries
8 entries across 8 versions & 1 rubygems