Class: ResqueWeb::Plugins::ResqueScheduler::SchedulesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ResqueWeb::Plugins::ResqueScheduler::SchedulesController
- Includes:
- Resque::Scheduler::Server::HelperMethods
- Defined in:
- app/controllers/resque_web/plugins/resque_scheduler/schedules_controller.rb
Overview
Controller for the schedule. If it is dynamic, then the actions allow the jobs to be destroyed. Otherwise, the jobs can be manually queued for immediate execution.
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /schedule.
-
#index ⇒ Object
GET /schedule.
-
#requeue ⇒ Object
POST /schedule/requeue.
-
#requeue_with_params ⇒ Object
POST /schedule/requeue_with_params.
Instance Method Details
#destroy ⇒ Object
DELETE /schedule
19 20 21 22 |
# File 'app/controllers/resque_web/plugins/resque_scheduler/schedules_controller.rb', line 19 def destroy Resque.remove_schedule(params[:job_name]) if Resque::Scheduler.dynamic redirect_to Engine.app.url_helpers.schedules_path end |
#index ⇒ Object
GET /schedule
13 14 15 16 |
# File 'app/controllers/resque_web/plugins/resque_scheduler/schedules_controller.rb', line 13 def index Resque.reload_schedule! if Resque::Scheduler.dynamic @scheduled_jobs = scheduled_jobs_in_alphabetical_order end |
#requeue ⇒ Object
POST /schedule/requeue
25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/resque_web/plugins/resque_scheduler/schedules_controller.rb', line 25 def requeue @job_name = params[:job_name] config = Resque.schedule[@job_name] @parameters = config['parameters'] || config[:parameters] if @parameters render 'requeue-params' else Resque::Scheduler.enqueue_from_config(config) redirect_to ResqueWeb::Engine.app.url_helpers.overview_path end end |
#requeue_with_params ⇒ Object
POST /schedule/requeue_with_params
38 39 40 41 42 43 |
# File 'app/controllers/resque_web/plugins/resque_scheduler/schedules_controller.rb', line 38 def requeue_with_params config = Resque.schedule[params[:job_name]] new_config = original_config_merged_with_submitted_params(config) Resque::Scheduler.enqueue_from_config(new_config) redirect_to ResqueWeb::Engine.app.url_helpers.overview_path end |