Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lantern staging #32

Merged
merged 2 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion migrate/20240507_lantern_doctor_queries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion model/lantern/lantern_doctor_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
1 change: 1 addition & 0 deletions spec/model/lantern/lantern_doctor_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading