diff --git a/model/lantern/lantern_doctor_query.rb b/model/lantern/lantern_doctor_query.rb index 94016932d..8811e8890 100644 --- a/model/lantern/lantern_doctor_query.rb +++ b/model/lantern/lantern_doctor_query.rb @@ -48,7 +48,7 @@ def response_type end def should_run? - CronParser.new(schedule).next(last_checked || Time.new - 61) <= Time.new + CronParser.new(schedule).next(last_checked || Time.new - 365 * 24 * 60 * 60) <= Time.new end def is_system? diff --git a/spec/model/lantern/lantern_doctor_query_spec.rb b/spec/model/lantern/lantern_doctor_query_spec.rb index a28c9a9dc..960bd419e 100644 --- a/spec/model/lantern/lantern_doctor_query_spec.rb +++ b/spec/model/lantern/lantern_doctor_query_spec.rb @@ -91,6 +91,7 @@ min = Time.new.min modified_min = (min == 59) ? 0 : min + 1 + expect(lantern_doctor_query).to receive(:last_checked).and_return(Time.new) expect(lantern_doctor_query).to receive(:schedule).and_return("#{modified_min} * * * *").at_least(:once) expect(lantern_doctor_query.should_run?).to be(false) end