mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-10 11:23:50 +02:00
Error when no jobs
This commit is contained in:
@@ -29,6 +29,7 @@ module Crono
|
|||||||
load_rails
|
load_rails
|
||||||
print_banner
|
print_banner
|
||||||
|
|
||||||
|
check_jobs
|
||||||
start_working_loop
|
start_working_loop
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -67,6 +68,12 @@ module Crono
|
|||||||
require File.expand_path(config.cronotab)
|
require File.expand_path(config.cronotab)
|
||||||
end
|
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
|
def start_working_loop
|
||||||
Thread.abort_on_exception = true
|
Thread.abort_on_exception = true
|
||||||
while job = Crono.scheduler.next do
|
while job = Crono.scheduler.next do
|
||||||
|
|||||||
Reference in New Issue
Block a user