Error when no jobs

This commit is contained in:
Dzmitry Plashchynski
2015-03-07 01:35:45 +02:00
parent b649594084
commit 2b53dc7ea1

View File

@@ -29,6 +29,7 @@ module Crono
load_rails
print_banner
check_jobs
start_working_loop
end
@@ -67,6 +68,12 @@ module Crono
require File.expand_path(config.cronotab)
end
def check_jobs
if Crono.scheduler.jobs.empty?
logger.error "You have no jobs defined in you cronotab file #{config.cronotab}"
end
end
def start_working_loop
Thread.abort_on_exception = true
while job = Crono.scheduler.next do