khronos 0.0.1.pre4 → 0.0.1.pre5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/khronos/server/controller.rb +14 -5
- data/lib/khronos/version.rb +1 -1
- metadata +1 -1
@@ -12,13 +12,22 @@ module Khronos
|
|
12
12
|
puts "WARNING: Not implemented yet."
|
13
13
|
end
|
14
14
|
|
15
|
+
def check_schedule!
|
16
|
+
puts "Check... #{Time.now}"
|
17
|
+
count = 0
|
18
|
+
@scheduler.fetch(Time.now).each do |schedule|
|
19
|
+
schedule.update_attributes(:status => false)
|
20
|
+
schedule.save
|
21
|
+
|
22
|
+
@scheduler.run(schedule)
|
23
|
+
count += 1
|
24
|
+
end
|
25
|
+
puts "Tick. #{count} jobs to run."
|
26
|
+
end
|
27
|
+
|
15
28
|
def start!
|
16
29
|
loop do
|
17
|
-
|
18
|
-
schedule.update_attributes(:status => false)
|
19
|
-
schedule.save
|
20
|
-
@scheduler.run(schedule)
|
21
|
-
end
|
30
|
+
check_schedule!
|
22
31
|
|
23
32
|
#
|
24
33
|
# Sleep 'interval' seconds
|
data/lib/khronos/version.rb
CHANGED