Class: RoundhouseUi::QueuesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RoundhouseUi::QueuesController
- Defined in:
- app/controllers/roundhouse_ui/queues_controller.rb
Constant Summary
Constants inherited from ApplicationController
ApplicationController::AUDIT_VERBS
Instance Method Summary collapse
- #index ⇒ Object
- #pause ⇒ Object
-
#purge ⇒ Object
Real, OSS-supported destructive action: empties the queue in Redis.
- #resume ⇒ Object
-
#snapshot ⇒ Object
Non-destructive backup — allowed even in read-only mode.
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'app/controllers/roundhouse_ui/queues_controller.rb', line 5 def index @queues = backend.queues @paused = backend.paused_queues # Native-pause backends (Solid Queue) enforce pauses without a fetcher, so # they never trigger the "not enforced" warning. @fetch_installed = backend.supports?(:native_pause) || (backend.respond_to?(:fetch_installed?) && backend.fetch_installed?) end |
#pause ⇒ Object
20 21 22 23 |
# File 'app/controllers/roundhouse_ui/queues_controller.rb', line 20 def pause backend.pause(params[:name]) redirect_to queues_path, notice: "Paused “#{params[:name]}”." end |
#purge ⇒ Object
Real, OSS-supported destructive action: empties the queue in Redis.
15 16 17 18 |
# File 'app/controllers/roundhouse_ui/queues_controller.rb', line 15 def purge backend.queue(params[:name]).clear redirect_to queues_path, notice: "Purged queue “#{params[:name]}”." end |
#resume ⇒ Object
25 26 27 28 |
# File 'app/controllers/roundhouse_ui/queues_controller.rb', line 25 def resume backend.resume(params[:name]) redirect_to queues_path, notice: "Resumed “#{params[:name]}”." end |
#snapshot ⇒ Object
Non-destructive backup — allowed even in read-only mode.
31 32 33 34 |
# File 'app/controllers/roundhouse_ui/queues_controller.rb', line 31 def snapshot snap = RoundhouseUi::Snapshots.take(params[:name]) redirect_to queues_path, notice: "Snapshot saved — #{snap[:count]} job(s) from “#{params[:name]}”." end |