mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-24 01:38:37 +02:00
Rename crono.rb to cronotab.rb
This commit is contained in:
@@ -6,6 +6,7 @@ module Crono
|
|||||||
|
|
||||||
def run
|
def run
|
||||||
load_rails
|
load_rails
|
||||||
|
require File.expand_path("config/cronotab.rb")
|
||||||
print_banner
|
print_banner
|
||||||
start_working_loop
|
start_working_loop
|
||||||
end
|
end
|
||||||
@@ -27,7 +28,9 @@ module Crono
|
|||||||
end
|
end
|
||||||
|
|
||||||
def start_working_loop
|
def start_working_loop
|
||||||
Config.instance.schedule.each do |klass, period|
|
loop do
|
||||||
|
klass, time = Config.instance.schedule.next
|
||||||
|
sleep(time - Time.now)
|
||||||
run_job(klass)
|
run_job(klass)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module Crono
|
|||||||
source_root File.expand_path("../templates", __FILE__)
|
source_root File.expand_path("../templates", __FILE__)
|
||||||
|
|
||||||
def copy_config
|
def copy_config
|
||||||
template 'crono.rb.erb', 'config/initializers/crono.rb'
|
template 'cronotab.rb.erb', 'config/cronotab.rb'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Crono configuration file
|
# cronotab.rb — Crono configuration file
|
||||||
#
|
#
|
||||||
# Here you can specify periodic jobs and their schedule.
|
# Here you can specify periodic jobs and their schedule.
|
||||||
# You can specify a periodic job as a ActiveJob class in `app/jobs/`
|
# You can specify a periodic job as a ActiveJob class in `app/jobs/`
|
||||||
Reference in New Issue
Block a user