FIX: Give up trying to reuse the DB connection and rely on pgbouncer (#79)

This commit is contained in:
Rafael dos Santos Silva 2023-05-23 15:12:59 -03:00 committed by GitHub
parent c582e3b848
commit b213fe7f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -3,13 +3,9 @@
module ::DiscourseAi module ::DiscourseAi
module Database module Database
class Connection class Connection
def self.connect!
pg_conn = PG.connect(SiteSetting.ai_embeddings_pg_connection_string)
@@db = MiniSql::Connection.get(pg_conn)
end
def self.db def self.db
@@db ||= connect! pg_conn = PG.connect(SiteSetting.ai_embeddings_pg_connection_string)
MiniSql::Connection.get(pg_conn)
end end
end end
end end