Sha256: 7f88bac64ee6e3fd710ee57a91d1e781a74f84edfb4a1cf339d572d6fd761b09

Contents?: true

Size: 585 Bytes

Versions: 3

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

module Aws
  module Rails
    module SqsActiveJob
      class JobRunner
        attr_reader :id, :class_name

        def initialize(message)
          @job_data = Aws::Json.load(message.data.body)
          @class_name = @job_data['job_class'].constantize
          @id = @job_data['job_id']
        end

        def run
          ActiveJob::Base.execute @job_data
        end

        def exception_executions?
          @job_data['exception_executions'] &&
            !@job_data['exception_executions'].empty?
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aws-sdk-rails-3.13.0 lib/aws/rails/sqs_active_job/job_runner.rb
aws-sdk-rails-3.12.0 lib/aws/rails/sqs_active_job/job_runner.rb
aws-sdk-rails-3.11.0 lib/aws/rails/sqs_active_job/job_runner.rb