lib/openwfe/util/scheduler.rb in openwferu-scheduler-0.9.14 vs lib/openwfe/util/scheduler.rb in openwferu-scheduler-0.9.15.1110
- old
+ new
@@ -572,11 +572,10 @@
#
def step
synchronize do
now = Time.new
- minute = now.min
if @exit_when_no_more_jobs
if @pending_jobs.size < 1
@@ -588,24 +587,22 @@
end
#
# cron entries
- if now.sec == 0 and
- (minute > @last_cron_minute or
- @last_cron_minute == 59)
+ if now.sec == 0 and now.min != @last_cron_minute
#
# only consider cron entries at the second 0 of a
# minute
- @last_cron_minute = minute
+ @last_cron_minute = now.min
#puts "step() @cron_entries.size #{@cron_entries.size}"
@cron_entries.each do |cron_id, cron_entry|
#puts "step() cron_id : #{cron_id}"
- trigger(cron_entry) if cron_entry.matches? now
+ trigger(cron_entry) if cron_entry.matches?(now)
end
end
#
# pending jobs
@@ -637,9 +634,10 @@
end
end
end
def trigger (entry)
+
Thread.new do
begin
entry.trigger
rescue Exception => e
message =