Module: CoreCronController
- Includes:
- CoreController
- Defined in:
- lib/app/controllers/concerns/core_cron_controller.rb
Overview
Manage cron job servers
Instance Method Summary collapse
-
#demote ⇒ Object
Demote a cron job server.
-
#destroy ⇒ Object
Destroy a cron job server.
-
#index ⇒ Object
Table to display cron job servers.
-
#run_now ⇒ Object
Run the crontab entry now.
-
#update ⇒ Object
Update a crontab entry.
Instance Method Details
#demote ⇒ Object
Demote a cron job server
43 44 45 46 47 48 49 50 |
# File 'lib/app/controllers/concerns/core_cron_controller.rb', line 43 def demote :edit, cron_server cron_server.become_secondary redirect_to index_path rescue StandardError => error log_controller_error error, true redirect_to index_path end |
#destroy ⇒ Object
Destroy a cron job server
55 56 57 58 59 60 61 62 |
# File 'lib/app/controllers/concerns/core_cron_controller.rb', line 55 def destroy :destroy, cron_server cron_server.destroy! redirect_to index_path rescue StandardError => error log_controller_error error, true redirect_to index_path end |
#index ⇒ Object
Table to display cron job servers
11 12 13 14 |
# File 'lib/app/controllers/concerns/core_cron_controller.rb', line 11 def index :read, Cron::Server :read, Cron::Tab end |
#run_now ⇒ Object
Run the crontab entry now
19 20 21 22 23 24 25 26 |
# File 'lib/app/controllers/concerns/core_cron_controller.rb', line 19 def run_now :read, cron_tab cron_tab.run redirect_to index_path rescue StandardError => error log_controller_error error, true redirect_to index_path end |
#update ⇒ Object
Update a crontab entry
31 32 33 34 35 36 37 38 |
# File 'lib/app/controllers/concerns/core_cron_controller.rb', line 31 def update :update, cron_tab cron_tab.update! cron_tab_params redirect_to index_path rescue StandardError => error log_controller_error error render :edit end |