mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
ping drizzle connection
This commit is contained in:
parent
349fa32ede
commit
165fc3fbf1
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user