Sha256: 08ff81f3d69b02acfc5d3d080492a99ffee8bb23db74fa69304208a0359383fb

Contents?: true

Size: 451 Bytes

Versions: 6

Compression:

Stored size: 451 Bytes

Contents

module Pliny::Sidekiq::Middleware
  module Client
    class Log
      def call(worker_class, msg, queue, redis_pool)
        yield.tap do
          data = {
            sidekiq:  true,
            job:      msg['class'],
            job_id:   msg['jid'],
            enqueued: true
          }
          data[:enqueued_at] = Time.at(msg['enqueued_at']) if msg.has_key?('enqueued_at')

          Pliny.log(data)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pliny-sidekiq-0.3.1 lib/pliny/sidekiq/middleware/client/log.rb
pliny-sidekiq-0.3.0 lib/pliny/sidekiq/middleware/client/log.rb
pliny-sidekiq-0.2.2 lib/pliny/sidekiq/middleware/client/log.rb
pliny-sidekiq-0.2.1 lib/pliny/sidekiq/middleware/client/log.rb
pliny-sidekiq-0.2.0 lib/pliny/sidekiq/middleware/client/log.rb
pliny-sidekiq-0.1.2 lib/pliny/sidekiq/middleware/client/log.rb