Skip to content

Commit

Permalink
Change daemon embeddings healthcheck query threshold from 1000 to 2000
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed May 29, 2024
1 parent e839ad3 commit 51bdadc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion model/lantern/lantern_doctor_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def check_daemon_embedding_jobs(db, query_user)

lantern_server = doctor.resource.representative_server
failed = jobs.any? do |job|
res = lantern_server.run_query("SELECT (SELECT COUNT(*) FROM \"#{job[:schema]}\".\"#{job[:table]}\" WHERE \"#{job[:src_column]}\" IS NOT NULL AND \"#{job[:src_column]}\" != '' AND \"#{job[:src_column]}\" != 'Error: Summary failed (llm)' AND \"#{job[:dst_column]}\" IS NULL) > 1000", db: db, user: query_user).strip
res = lantern_server.run_query("SELECT (SELECT COUNT(*) FROM \"#{job[:schema]}\".\"#{job[:table]}\" WHERE \"#{job[:src_column]}\" IS NOT NULL AND \"#{job[:src_column]}\" != '' AND \"#{job[:src_column]}\" != 'Error: Summary failed (llm)' AND \"#{job[:dst_column]}\" IS NULL) > 2000", db: db, user: query_user).strip
res == "t"
end

Expand Down
4 changes: 2 additions & 2 deletions spec/model/lantern/lantern_doctor_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
where: instance_double(Sequel::Dataset,
where: instance_double(Sequel::Dataset,
all: [{schema: "public", table: "test", src_column: "test-src", dst_column: "test-dst"}]))))))
expect(serv).to receive(:run_query).with("SELECT (SELECT COUNT(*) FROM \"public\".\"test\" WHERE \"test-src\" IS NOT NULL AND \"test-src\" != '' AND \"test-src\" != 'Error: Summary failed (llm)' AND \"test-dst\" IS NULL) > 1000", db: "postgres", user: "postgres").and_return("t")
expect(serv).to receive(:run_query).with("SELECT (SELECT COUNT(*) FROM \"public\".\"test\" WHERE \"test-src\" IS NOT NULL AND \"test-src\" != '' AND \"test-src\" != 'Error: Summary failed (llm)' AND \"test-dst\" IS NULL) > 2000", db: "postgres", user: "postgres").and_return("t")
expect(lantern_doctor_query.check_daemon_embedding_jobs("postgres", "postgres")).to eq("t")
end

Expand Down Expand Up @@ -426,7 +426,7 @@
where: instance_double(Sequel::Dataset,
where: instance_double(Sequel::Dataset,
all: [{schema: "public", table: "test", src_column: "test-src", dst_column: "test-dst"}]))))))
expect(serv).to receive(:run_query).with("SELECT (SELECT COUNT(*) FROM \"public\".\"test\" WHERE \"test-src\" IS NOT NULL AND \"test-src\" != '' AND \"test-src\" != 'Error: Summary failed (llm)' AND \"test-dst\" IS NULL) > 1000", db: "postgres", user: "postgres").and_return("f")
expect(serv).to receive(:run_query).with("SELECT (SELECT COUNT(*) FROM \"public\".\"test\" WHERE \"test-src\" IS NOT NULL AND \"test-src\" != '' AND \"test-src\" != 'Error: Summary failed (llm)' AND \"test-dst\" IS NULL) > 2000", db: "postgres", user: "postgres").and_return("f")
expect(lantern_doctor_query.check_daemon_embedding_jobs("postgres", "postgres")).to eq("f")
end

Expand Down

0 comments on commit 51bdadc

Please sign in to comment.