Class: RoundhouseUi::BusyController

Inherits:
ApplicationController show all
Defined in:
app/controllers/roundhouse_ui/busy_controller.rb

Overview

What's executing right now, from Sidekiq::WorkSet — the live in-flight jobs Sidekiq Web calls "Busy". Surfaces long-running (possibly hung) jobs, which the stock UI makes you eyeball.

Constant Summary collapse

LONG_RUNNING =

seconds

60

Constants inherited from ApplicationController

ApplicationController::AUDIT_VERBS

Instance Method Summary collapse

Methods inherited from ApplicationController

#redirect_to

Instance Method Details

#cancelObject



15
16
17
18
# File 'app/controllers/roundhouse_ui/busy_controller.rb', line 15

def cancel
  RoundhouseUi::Cancellation.cancel!(params[:jid])
  redirect_to busy_path, notice: "Cancellation requested for #{params[:jid]}."
end

#indexObject



10
11
12
13
# File 'app/controllers/roundhouse_ui/busy_controller.rb', line 10

def index
  @threshold = LONG_RUNNING
  @work = Sidekiq::WorkSet.new.map { |process_id, tid, work| normalize(process_id, tid, work) }
end