Sha256: 7bb5bc0c8f05a6141eea75afa7cafff16deecb55cb24fb08012232ed3b910723

Contents?: true

Size: 1.03 KB

Versions: 22

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module Appsignal
  module Integrations
    # @api private
    module QuePlugin
      def _run(*)
        transaction =
          Appsignal::Transaction.create(Appsignal::Transaction::BACKGROUND_JOB)

        begin
          Appsignal.instrument("perform_job.que") { super }
        rescue Exception => error # rubocop:disable Lint/RescueException
          transaction.set_error(error)
          raise error
        ensure
          local_attrs = respond_to?(:que_attrs) ? que_attrs : attrs
          transaction.set_action_if_nil("#{local_attrs[:job_class]}#run")
          transaction.set_params_if_nil(local_attrs[:args])
          transaction.set_tags(
            "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
          )
          Appsignal::Transaction.complete_current!
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
appsignal-3.13.1-java lib/appsignal/integrations/que.rb
appsignal-3.13.1 lib/appsignal/integrations/que.rb
appsignal-3.13.1.alpha.1-java lib/appsignal/integrations/que.rb
appsignal-3.13.1.alpha.1 lib/appsignal/integrations/que.rb
appsignal-3.13.0-java lib/appsignal/integrations/que.rb
appsignal-3.13.0 lib/appsignal/integrations/que.rb
appsignal-3.12.6-java lib/appsignal/integrations/que.rb
appsignal-3.12.6 lib/appsignal/integrations/que.rb
appsignal-3.12.5-java lib/appsignal/integrations/que.rb
appsignal-3.12.5 lib/appsignal/integrations/que.rb
appsignal-3.12.4-java lib/appsignal/integrations/que.rb
appsignal-3.12.4 lib/appsignal/integrations/que.rb
appsignal-3.12.3-java lib/appsignal/integrations/que.rb
appsignal-3.12.3 lib/appsignal/integrations/que.rb
appsignal-3.12.2-java lib/appsignal/integrations/que.rb
appsignal-3.12.2 lib/appsignal/integrations/que.rb
appsignal-3.12.1-java lib/appsignal/integrations/que.rb
appsignal-3.12.1 lib/appsignal/integrations/que.rb
appsignal-3.12.0-java lib/appsignal/integrations/que.rb
appsignal-3.12.0 lib/appsignal/integrations/que.rb