Class: ScheduledTasksController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/scheduled_tasks_controller.rb

Instance Method Summary collapse

Instance Method Details

#logObject



26
27
28
29
# File 'app/controllers/scheduled_tasks_controller.rb', line 26

def log
  record = find_if_allowed(params[:id], :read)
  @log_file = record.log_file(params[:identifier])
end

#run_nowObject



38
39
40
41
42
43
44
# File 'app/controllers/scheduled_tasks_controller.rb', line 38

def run_now
  process_action_link_action do |record|
    record.update!(next_run: Time.zone.now)
    record.reload
    flash[:info] = "Next run adjusted to #{record.next_run}"
  end
end

#statusObject



31
# File 'app/controllers/scheduled_tasks_controller.rb', line 31

def status; end

#status_contentObject



33
34
35
36
# File 'app/controllers/scheduled_tasks_controller.rb', line 33

def status_content
  @scheduled_tasks = ::ScheduledTask.order(task: :asc, scheduling: :asc)
  render layout: false
end