From b213fe7f94000205496ea5243c4801d4b3ebb252 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Tue, 23 May 2023 15:12:59 -0300 Subject: [PATCH] FIX: Give up trying to reuse the DB connection and rely on pgbouncer (#79) --- lib/shared/database/connection.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/shared/database/connection.rb b/lib/shared/database/connection.rb index 13ee2aac..f591e188 100644 --- a/lib/shared/database/connection.rb +++ b/lib/shared/database/connection.rb @@ -3,13 +3,9 @@ module ::DiscourseAi module Database 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 - @@db ||= connect! + pg_conn = PG.connect(SiteSetting.ai_embeddings_pg_connection_string) + MiniSql::Connection.get(pg_conn) end end end