lib/deputy.rb in deputy-0.1.20 vs lib/deputy.rb in deputy-0.1.21
- old
+ new
@@ -92,11 +92,11 @@
def self.run_plugins
content = get("/plugins.rb")
Scout.plugins(content).each do |interval, plugin|
run_every_n_minutes = interval/60
- minutes_to_wait = START_MINUTE % run_every_n_minutes
- if minutes_to_wait == 0
+ minutes_to_wait = run_every_n_minutes - (START_MINUTE % run_every_n_minutes)
+ if minutes_to_wait == run_every_n_minutes
puts "#{plugin.clean_class_name}: running"
plugin.new.build_report
else
puts "#{plugin.clean_class_name}: waiting another #{minutes_to_wait} minutes"
end
\ No newline at end of file