mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Improve health check (#6205)
* remove unnecesary Db re-initialization this is from before we added `Db.init` in `WorkflowRunnerProcess` * feat(core): Improved health check * make health check not care about DB connections * close DB connections, and shutdown the timer
This commit is contained in:
committed by
GitHub
parent
e3f47994b1
commit
9e7b9fb443
@@ -58,7 +58,7 @@ export async function init() {
|
||||
|
||||
if (dbType === 'sqlite') {
|
||||
// no bootstrap connection required
|
||||
return Db.init(getSqliteOptions({ name: testDbName }));
|
||||
await Db.init(getSqliteOptions({ name: testDbName }));
|
||||
}
|
||||
|
||||
if (dbType === 'postgresdb') {
|
||||
@@ -89,7 +89,7 @@ export async function init() {
|
||||
await bootstrapPostgres.query(`CREATE DATABASE ${testDbName}`);
|
||||
await bootstrapPostgres.destroy();
|
||||
|
||||
return Db.init(getDBOptions('postgres', testDbName));
|
||||
await Db.init(getDBOptions('postgres', testDbName));
|
||||
}
|
||||
|
||||
if (dbType === 'mysqldb') {
|
||||
@@ -97,18 +97,17 @@ export async function init() {
|
||||
await bootstrapMysql.query(`CREATE DATABASE ${testDbName}`);
|
||||
await bootstrapMysql.destroy();
|
||||
|
||||
return Db.init(getDBOptions('mysql', testDbName));
|
||||
await Db.init(getDBOptions('mysql', testDbName));
|
||||
}
|
||||
|
||||
throw new Error(`Unrecognized DB type: ${dbType}`);
|
||||
await Db.migrate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop test DB, closing bootstrap connection if existing.
|
||||
*/
|
||||
export async function terminate() {
|
||||
const connection = Db.getConnection();
|
||||
if (connection.isInitialized) await connection.destroy();
|
||||
await Db.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user