forked from rails/mission_control-jobs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79c9f69
commit dd8a6ae
Showing
4 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
app/controllers/mission_control/jobs/queues/status_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class MissionControl::Jobs::Queues::StatusController < ApplicationController | ||
before_action :set_queue | ||
|
||
def pause | ||
@queue.pause | ||
redirect_to queues_url | ||
end | ||
|
||
def resume | ||
@queue.resume | ||
redirect_to queues_url | ||
end | ||
|
||
private | ||
def set_queue | ||
@queue = ActiveJob::Base.queue(params[:queue_id]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
MissionControl::Jobs::Engine.routes.draw do | ||
resources :queues | ||
resources :queues do | ||
scope module: :queues do | ||
resource :status, controller: "status", only: [] do | ||
put "pause", "resume", on: :member | ||
end | ||
end | ||
end | ||
|
||
root to: "queues#index" | ||
end |