class Pliny::Sidekiq::Middleware::Server::RequestId

Public Class Methods

new(store: Pliny::RequestStore) click to toggle source
# File lib/pliny/sidekiq/middleware/server/request_id.rb, line 4
def initialize(store: Pliny::RequestStore)
  @store = store
end

Public Instance Methods

call(worker, job, queue) { || ... } click to toggle source
# File lib/pliny/sidekiq/middleware/server/request_id.rb, line 8
def call(worker, job, queue)
  @store.clear!
  @store.seed({
    'REQUEST_IDS' => job['request_ids']
  }) if job.include?('request_ids')

  yield
end