Sha256: a4c33767830ea2160029d7d5c4d498fa59f6c1bb6978e3850d5e7e0d0d6210d6

Contents?: true

Size: 585 Bytes

Versions: 4

Compression:

Stored size: 585 Bytes

Contents

module Sidekiq
  module Middleware
    module Server
      class FailureJobs
        def call(*args)
          yield
        rescue => e
          data = {
            :failed_at => Time.now.strftime("%Y/%m/%d %H:%M:%S %Z"),
            :payload => args[1],
            :exception => e.class.to_s,
            :error => e.to_s,
            :backtrace => e.backtrace,
            :worker => args[1]['class'],
            :queue => args[2]
          }
          Sidekiq.redis {|conn| conn.rpush(:failed, Sidekiq.dump_json(data)) }
          raise
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sidekiq-2.0.3 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-2.0.2 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-2.0.1 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-2.0.0 lib/sidekiq/middleware/server/failure_jobs.rb