Class: TasksSchedulerDaemonController

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

Instance Method Summary collapse

Instance Method Details

#download_logObject



15
16
17
18
19
20
21
22
# File 'app/controllers/tasks_scheduler_daemon_controller.rb', line 15

def download_log
  if File.exist?(::TasksScheduler::Checker.instance.log_path)
    send_log_file
  else
    redirect_to(tasks_scheduler_daemon_path,
                notice: "Arquivo \"#{::TasksScheduler::Checker.instance.log_path}\" não existe")
  end
end

#executeObject



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

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

#indexObject



2
3
# File 'app/controllers/tasks_scheduler_daemon_controller.rb', line 2

def index
end

#statusObject



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

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