lib/nestene/actor/delayed_scheduler.rb in nestene-0.1.7 vs lib/nestene/actor/delayed_scheduler.rb in nestene-0.1.8
- old
+ new
@@ -63,11 +63,15 @@
break
end
end
unless @schedule.empty?
- to_wait = @schedule.first[1].execute_at - now
- @timer = after(to_wait){async.schedule_methods}
+ if now >= @schedule.first[1].execute_at
+ async.schedule_methods
+ else
+ to_wait = @schedule.first[1].execute_at - now
+ @timer = after(to_wait){async.schedule_methods}
+ end
end
end
end