Sha256: e730a0c75ae26d479f1ab6904079115c94f09171dd1789ac58b9a139c01acc73

Contents?: true

Size: 585 Bytes

Versions: 11

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, MultiJson.encode(data)) }
          raise
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sidekiq-1.1.2 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-1.1.1 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-1.1.0 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-1.0.0 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-0.11.2 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-0.11.1 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-0.11.0 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-0.10.1 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-0.10.0 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-0.9.1 lib/sidekiq/middleware/server/failure_jobs.rb
sidekiq-0.9.0 lib/sidekiq/middleware/server/failure_jobs.rb