Sha256: 739c66a2083db42e99590b3391776caa7e82cb001564112adcb091d32018c7d9

Contents?: true

Size: 566 Bytes

Versions: 9

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

module RailsWorkflow
  # Rails workflow operation can run in background
  # (if is_background = true). This job is responsible
  # for performing operation in background.
  class OperationExecutionJob < ActiveJob::Base
    queue_as :default

    def perform(*args)
      operation_id = args[0]

      operation = Operation.find operation_id
      operation_runner.new(operation).execute_in_transaction
    end

    def config
      RailsWorkflow.config
    end

    def operation_runner
      config.operation_runner
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_workflow-0.7.3 app/jobs/rails_workflow/operation_execution_job.rb
rails_workflow-0.7.2 app/jobs/rails_workflow/operation_execution_job.rb
rails_workflow-0.7.1 app/jobs/rails_workflow/operation_execution_job.rb
rails_workflow-0.7.0 app/jobs/rails_workflow/operation_execution_job.rb
rails_workflow-0.4.4 app/jobs/rails_workflow/operation_execution_job.rb
rails_workflow-0.4.3 app/jobs/rails_workflow/operation_execution_job.rb
rails_workflow-0.4.2 app/jobs/rails_workflow/operation_execution_job.rb
rails_workflow-0.4.1 app/jobs/rails_workflow/operation_execution_job.rb
rails_workflow-0.4.0 app/jobs/rails_workflow/operation_execution_job.rb