Sha256: ff3b77af432a44e78971efc8a612b9967eddef92efd4166e686ca4fa17390dde

Contents?: true

Size: 612 Bytes

Versions: 15

Compression:

Stored size: 612 Bytes

Contents

# frozen_string_literal: true

require "kiev/shoryuken/context_reader"

module Kiev
  module Shoryuken
    module Middleware
      class StoreRequestDetails
        def call(_worker, _queue, message, _body)
          context_reader = Kiev::Shoryuken::ContextReader.new(message)
          Config.instance.jobs_propagated_fields.each do |key|
            Kiev[key] = context_reader[key]
          end
          request_store = Kiev::RequestStore.store
          request_store[:background_job] = true
          request_store[:message_id] = message.message_id
          yield
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kiev-4.9.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.8.3 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.8.2 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.8.1 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.8.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.7.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.6.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.5.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.4.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.3.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.2.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.1.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-4.0.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-3.0.0 lib/kiev/shoryuken/middleware/store_request_details.rb
kiev-2.8.0 lib/kiev/shoryuken/middleware/store_request_details.rb