diff --git a/migrate/20240507_lantern_doctor_queries.rb b/migrate/20240507_lantern_doctor_queries.rb index 32e8e36f1..d58525ba8 100644 --- a/migrate/20240507_lantern_doctor_queries.rb +++ b/migrate/20240507_lantern_doctor_queries.rb @@ -47,7 +47,7 @@ JOIN pg_am a ON i.relam = a.oid JOIN pg_namespace n ON n.oid = i.relnamespace WHERE a.amname = 'lantern_hnsw') -SELECT idx_size.size::bigint > setting::bigint FROM idx_size, pg_settings WHERE name = 'shared_buffers'; +SELECT idx_size.size::bigint > setting::bigint * 8196 FROM idx_size, pg_settings WHERE name = 'shared_buffers'; SQL DB[:lantern_doctor_query].insert( id: "98c0d832-90ea-85b7-9ba5-7c8e1da653ce", 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