Sha256: 81a7ad900d68778a66e71ecddb8fd94b0fa9580e12f0ac0c60eef41a9534d284

Contents?: true

Size: 1.15 KB

Versions: 110

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module Appsignal
  module Integrations
    module QuePlugin
      def _run(*)
        local_attrs = respond_to?(:que_attrs) ? que_attrs : attrs
        env = {
          :metadata    => {
            :id        => local_attrs[:job_id] || local_attrs[:id],
            :queue     => local_attrs[:queue],
            :run_at    => local_attrs[:run_at].to_s,
            :priority  => local_attrs[:priority],
            :attempts  => local_attrs[:error_count].to_i
          },
          :params => local_attrs[:args]
        }

        request = Appsignal::Transaction::GenericRequest.new(env)

        transaction = Appsignal::Transaction.create(
          SecureRandom.uuid,
          Appsignal::Transaction::BACKGROUND_JOB,
          request
        )

        begin
          Appsignal.instrument("perform_job.que") { super }
        rescue Exception => error # rubocop:disable Lint/RescueException
          transaction.set_error(error)
          raise error
        ensure
          transaction.set_action_if_nil "#{local_attrs[:job_class]}#run"
          Appsignal::Transaction.complete_current!
        end
      end
    end
  end
end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
appsignal-3.3.11-java lib/appsignal/integrations/que.rb
appsignal-3.3.11 lib/appsignal/integrations/que.rb
appsignal-3.4.0-java lib/appsignal/integrations/que.rb
appsignal-3.4.0 lib/appsignal/integrations/que.rb
appsignal-3.3.10-java lib/appsignal/integrations/que.rb
appsignal-3.3.10 lib/appsignal/integrations/que.rb
appsignal-3.3.9-java lib/appsignal/integrations/que.rb
appsignal-3.3.9 lib/appsignal/integrations/que.rb
appsignal-3.3.8-java lib/appsignal/integrations/que.rb
appsignal-3.3.8 lib/appsignal/integrations/que.rb
appsignal-3.3.7-java lib/appsignal/integrations/que.rb
appsignal-3.3.7 lib/appsignal/integrations/que.rb
appsignal-3.3.6-java lib/appsignal/integrations/que.rb
appsignal-3.3.6 lib/appsignal/integrations/que.rb
appsignal-3.3.5-java lib/appsignal/integrations/que.rb
appsignal-3.3.5 lib/appsignal/integrations/que.rb
appsignal-3.3.4-java lib/appsignal/integrations/que.rb
appsignal-3.3.4 lib/appsignal/integrations/que.rb
appsignal-3.3.3-java lib/appsignal/integrations/que.rb
appsignal-3.3.3 lib/appsignal/integrations/que.rb