Class: Flightdeck::QueuesController

Inherits:
ApplicationController show all
Includes:
Toasts
Defined in:
app/controllers/flightdeck/queues_controller.rb

Constant Summary

Constants inherited from ApplicationController

ApplicationController::UNCONFIGURED_MESSAGE

Instance Method Summary collapse

Methods inherited from ApplicationController

host_authenticated?

Instance Method Details

#indexObject



10
11
# File 'app/controllers/flightdeck/queues_controller.rb', line 10

def index
end

#pauseObject

Pausing and resuming are Solid Queue's own Queue#pause / #resume: they own what a pause means, and Flightdeck never writes solid_queue_pauses itself.



15
16
17
18
19
20
# File 'app/controllers/flightdeck/queues_controller.rb', line 15

def pause
  SolidQueue::Queue.new(@queue_name).pause
  reload_stats
  toast "Paused #{@queue_name}. Workers will stop picking up its jobs."
  respond_with_toast queues_frame, fallback: queues_path
end

#resumeObject



22
23
24
25
26
27
# File 'app/controllers/flightdeck/queues_controller.rb', line 22

def resume
  SolidQueue::Queue.new(@queue_name).resume
  reload_stats
  toast "Resumed #{@queue_name}."
  respond_with_toast queues_frame, fallback: queues_path
end