Sha256: a15c63356b548a73165fa3b24f90cfa63b585af0899c22921a6c456512342b18
Contents?: true
Size: 894 Bytes
Versions: 4
Compression:
Stored size: 894 Bytes
Contents
# frozen_string_literal: true # Copyright The OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 module OpenTelemetry module Instrumentation module ActiveJob module Patches # Module to prepend to ActiveJob::Core for context propagation. module Base def self.prepended(base) base.class_eval do attr_accessor :metadata end end def initialize(*args) @metadata = {} super end ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true) def serialize super.merge('metadata' => serialize_arguments(metadata)) end def deserialize(job_data) self.metadata = (deserialize_arguments(job_data['metadata']) || []).to_h super end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems