Sha256: 112e7c5c933b108e8c3ae6be8fbd5eae1bcd4f3c99c86f147f1b8145340dc9ab

Contents?: true

Size: 831 Bytes

Versions: 22

Compression:

Stored size: 831 Bytes

Contents

require 'ddtrace/contrib/patcher'
require 'ddtrace/ext/app_types'
require 'ddtrace/contrib/sidekiq/ext'

module Datadog
  module Contrib
    module Resque
      # Patcher enables patching of 'resque' module.
      module Patcher
        include Contrib::Patcher

        module_function

        def patched?
          done?(:resque)
        end

        def patch
          do_once(:resque) do
            begin
              require_relative 'resque_job'
              get_option(:workers).each { |worker| worker.extend(ResqueJob) }
            rescue StandardError => e
              Datadog::Tracer.log.error("Unable to apply Resque integration: #{e}")
            end
          end
        end

        def get_option(option)
          Datadog.configuration[:resque].get_option(option)
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
ls-trace-0.1.2 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.29.1 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.26.1 lib/ddtrace/contrib/resque/patcher.rb
ls-trace-0.1.1 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.29.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.28.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.27.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.26.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.25.1 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.25.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.24.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.23.3 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.23.2 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.23.1 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.23.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.22.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.21.2 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.21.1 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.21.0 lib/ddtrace/contrib/resque/patcher.rb
ddtrace-0.20.0 lib/ddtrace/contrib/resque/patcher.rb