Class: RoundhouseUi::RetriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RoundhouseUi::RetriesController
- Includes:
- JobSetBrowsing
- Defined in:
- app/controllers/roundhouse_ui/retries_controller.rb
Constant Summary
Constants included from JobSetBrowsing
JobSetBrowsing::BULK_CAP, JobSetBrowsing::PER_PAGE
Constants inherited from ApplicationController
ApplicationController::AUDIT_VERBS
Instance Method Summary collapse
-
#bulk_all ⇒ Object
Smart bulk: retry/delete EVERY job matching the current filter, capped for safety.
- #destroy ⇒ Object
- #index ⇒ Object
-
#requeue ⇒ Object
Retry now — moves the job back to its queue immediately.
Methods included from JobSetBrowsing
#browse, #bulk_apply, #entry_matches?
Methods inherited from ApplicationController
Instance Method Details
#bulk_all ⇒ Object
Smart bulk: retry/delete EVERY job matching the current filter, capped for safety. Offered only when a filter is active.
29 30 31 32 33 34 35 |
# File 'app/controllers/roundhouse_ui/retries_controller.rb', line 29 def bulk_all count, capped = bulk_apply(Sidekiq::RetrySet.new, params[:q].to_s.strip, params[:op]) verb = params[:op] == "delete" ? "Deleted" : "Re-enqueued" note = "#{verb} #{count} matching job(s)." note += " Stopped at the #{JobSetBrowsing::BULK_CAP} cap — run again for more." if capped redirect_to retries_path, notice: note end |
#destroy ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/roundhouse_ui/retries_controller.rb', line 21 def destroy entry = Sidekiq::RetrySet.new.find_job(params[:jid]) entry&.delete redirect_to retries_path, notice: entry ? "Deleted #{params[:jid]}." : "Job is no longer in the retry set." end |
#index ⇒ Object
7 8 9 10 11 12 |
# File 'app/controllers/roundhouse_ui/retries_controller.rb', line 7 def index @query = params[:q].to_s.strip @page = [ params[:page].to_i, 1 ].max @total = Sidekiq::RetrySet.new.size @jobs, @has_next = browse(Sidekiq::RetrySet.new, @query, @page) end |
#requeue ⇒ Object
Retry now — moves the job back to its queue immediately.
15 16 17 18 19 |
# File 'app/controllers/roundhouse_ui/retries_controller.rb', line 15 def requeue entry = Sidekiq::RetrySet.new.find_job(params[:jid]) entry&.retry redirect_to retries_path, notice: entry ? "Re-enqueued #{params[:jid]}." : "Job is no longer in the retry set." end |