Sha256: db9042cd84abeaf1b9a342a8195ad321463bf0b7169a33949f0398fe5467b0d6

Contents?: true

Size: 1.13 KB

Versions: 80

Compression:

Stored size: 1.13 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

80 entries across 80 versions & 1 rubygems

Version Path
appsignal-3.10.0-java lib/appsignal/integrations/que.rb
appsignal-3.10.0 lib/appsignal/integrations/que.rb
appsignal-3.9.3-java lib/appsignal/integrations/que.rb
appsignal-3.9.3 lib/appsignal/integrations/que.rb
appsignal-3.9.2-java lib/appsignal/integrations/que.rb
appsignal-3.9.2 lib/appsignal/integrations/que.rb
appsignal-3.9.1-java lib/appsignal/integrations/que.rb
appsignal-3.9.1 lib/appsignal/integrations/que.rb
appsignal-3.9.0-java lib/appsignal/integrations/que.rb
appsignal-3.9.0 lib/appsignal/integrations/que.rb
appsignal-3.8.1-java lib/appsignal/integrations/que.rb
appsignal-3.8.1 lib/appsignal/integrations/que.rb
appsignal-3.8.0-java lib/appsignal/integrations/que.rb
appsignal-3.8.0 lib/appsignal/integrations/que.rb
appsignal-3.7.6-java lib/appsignal/integrations/que.rb
appsignal-3.7.6 lib/appsignal/integrations/que.rb
appsignal-3.7.2-java lib/appsignal/integrations/que.rb
appsignal-3.7.2 lib/appsignal/integrations/que.rb
appsignal-3.7.1-java lib/appsignal/integrations/que.rb
appsignal-3.7.1 lib/appsignal/integrations/que.rb