From 165fc3fbf1187774de0dd113611af9f196470a5b Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 6 Dec 2025 15:01:10 +0100 Subject: [PATCH] ping drizzle connection --- database/src/AppDatabase.ts | 2 +- database/src/queries/openaiThreads.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/database/src/AppDatabase.ts b/database/src/AppDatabase.ts index 8a359a1fb..72ee114c8 100644 --- a/database/src/AppDatabase.ts +++ b/database/src/AppDatabase.ts @@ -1,4 +1,3 @@ -import { sql } from 'drizzle-orm' import { drizzle, MySql2Database } from 'drizzle-orm/mysql2' import Redis from 'ioredis' import { getLogger } from 'log4js' @@ -92,6 +91,7 @@ export class AppDatabase { database: CONFIG.DB_DATABASE, port: CONFIG.DB_PORT, }) + await this.drizzleConnection.ping() this.drizzleDataSource = drizzle({ client: this.drizzleConnection }) } // retry connection on failure some times to allow database to catch up diff --git a/database/src/queries/openaiThreads.test.ts b/database/src/queries/openaiThreads.test.ts index 44f4a112f..3bf80f669 100644 --- a/database/src/queries/openaiThreads.test.ts +++ b/database/src/queries/openaiThreads.test.ts @@ -16,7 +16,7 @@ let db: MySql2Database beforeAll(async () => { await appDB.init() db = appDB.getDrizzleDataSource() - // await db.delete(openaiThreadsTable) + await db.delete(openaiThreadsTable) }) afterAll(async () => { await appDB.destroy()