Class: SagaForge::Dashboard::ActionsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- SagaForge::Dashboard::ActionsController
- Defined in:
- app/controllers/saga_forge/dashboard/actions_controller.rb
Instance Method Summary collapse
-
#bulk ⇒ Object
Fans the retry/resume out to a background job scoped to one saga class.
- #cancel ⇒ Object
- #compensate ⇒ Object
- #resume ⇒ Object
- #retry_stalled ⇒ Object
Instance Method Details
#bulk ⇒ Object
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 |
#cancel ⇒ Object
10 |
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 10 def cancel = run { @state.cancel!(reason: params[:reason].presence || "operator") } |
#compensate ⇒ Object
8 |
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 8 def compensate = run { @state.compensate! } |
#resume ⇒ Object
6 |
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 6 def resume = run { @state.resume! } |
#retry_stalled ⇒ Object
4 |
# File 'app/controllers/saga_forge/dashboard/actions_controller.rb', line 4 def retry_stalled = run { @state.retry_stalled! } |