Sha256: b7ca20353462ebd755b79f66b3688482ef18cc696e4149d0b3d5d8d0390aef41

Contents?: true

Size: 653 Bytes

Versions: 47

Compression:

Stored size: 653 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)
        ::Sidekiq::Client.push @options.merge('args' => [payload])
      end

      include ::Sidekiq::Worker

      def perform(*args)
        begin
          Rollbar.process_from_async_handler(*args)
        rescue
          # Raise the exception so Sidekiq can track the errored job
          # and retry it
          raise
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
rollbar-2.18.2 lib/rollbar/delay/sidekiq.rb
rollbar-2.18.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.17.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.16.4 lib/rollbar/delay/sidekiq.rb
rollbar-2.16.3 lib/rollbar/delay/sidekiq.rb
rollbar-2.16.2 lib/rollbar/delay/sidekiq.rb
rollbar-2.16.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.15.6 lib/rollbar/delay/sidekiq.rb
rollbar-2.15.5 lib/rollbar/delay/sidekiq.rb
rollbar-2.15.4 lib/rollbar/delay/sidekiq.rb
rollbar-2.15.3 lib/rollbar/delay/sidekiq.rb
rollbar-2.15.2 lib/rollbar/delay/sidekiq.rb
rollbar-2.15.1 lib/rollbar/delay/sidekiq.rb
rollbar-2.15.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.14.1 lib/rollbar/delay/sidekiq.rb
rollbar-2.14.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.13.3 lib/rollbar/delay/sidekiq.rb
rollbar-2.13.2 lib/rollbar/delay/sidekiq.rb
rollbar-2.13.1 lib/rollbar/delay/sidekiq.rb
rollbar-2.13.0 lib/rollbar/delay/sidekiq.rb