Class: TasksSchedulerDaemonController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/tasks_scheduler_daemon_controller.rb,
app/controllers/tasks_scheduler_daemon_controller/_download_log.rb

Instance Method Summary collapse

Instance Method Details

#download_logObject



4
5
6
7
8
9
10
11
# File 'app/controllers/tasks_scheduler_daemon_controller/_download_log.rb', line 4

def download_log
  return unless download_log_validate_log_key

  log = ::TasksScheduler::Checker.instance.send("#{download_log_key}_log")
  return unless download_log_validate_log_exist(log)

  send_log_file(log)
end

#executeObject



10
11
12
13
# File 'app/controllers/tasks_scheduler_daemon_controller.rb', line 10

def execute
  @result = ::TasksScheduler::Daemon.execute(params[:tasks_scheduler_execute_action])
  render 'index'
end

#indexObject



8
# File 'app/controllers/tasks_scheduler_daemon_controller.rb', line 8

def index; end

#statusObject



15
16
17
18
# File 'app/controllers/tasks_scheduler_daemon_controller.rb', line 15

def status
  render json: { daemon_running: ::TasksScheduler::Daemon.running?,
                 tasks_all_ok: ::ScheduledTask.all.none?(&:failed?) }
end