Class: SagaForge::Dashboard::ActionsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/saga_forge/dashboard/actions_controller.rb

Instance Method Summary collapse

Instance Method Details

#bulkObject

Fans the retry/resume out to a background job scoped to one saga class. The stalled/suspended lists are cross-class, so the class is named explicitly rather than inferred from a single instance.



15
16
17
18
19
20
21
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 15

def bulk
  klass = SagaForge::Router.saga_classes.find { |k| k.name == params[:saga_class] }
  return redirect_back(fallback_location: root_path, alert: "Unknown saga class.") unless klass

  BulkRecoveryJob.perform_later(klass.name, params[:mode])
  redirect_back(fallback_location: root_path, notice: "Bulk #{params[:mode]} enqueued for #{klass.name}.")
end

#cancelObject



10
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 10

def cancel = run { @state.cancel!(reason: params[:reason].presence || "operator") }

#compensateObject



8
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 8

def compensate = run { @state.compensate! }

#resumeObject



6
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 6

def resume = run { @state.resume! }

#retry_stalledObject



4
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 4

def retry_stalled = run { @state.retry_stalled! }