|
|
@ -40,20 +40,22 @@ class Database {
|
|
|
|
|
|
|
|
|
|
|
|
Dialect.prototype.destroyRawConnection = async () => { }
|
|
|
|
Dialect.prototype.destroyRawConnection = async () => { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const acquireConnectionTimeout = 120 * 1000;
|
|
|
|
|
|
|
|
|
|
|
|
const knexInstance = knex({
|
|
|
|
const knexInstance = knex({
|
|
|
|
client: Dialect,
|
|
|
|
client: Dialect,
|
|
|
|
connection: { }, // Do not remove, Leave it empty is ok
|
|
|
|
connection: { }, // Do not remove, Leave it empty is ok
|
|
|
|
useNullAsDefault: true,
|
|
|
|
useNullAsDefault: true,
|
|
|
|
|
|
|
|
acquireConnectionTimeout: acquireConnectionTimeout,
|
|
|
|
pool: {
|
|
|
|
pool: {
|
|
|
|
min: 1,
|
|
|
|
min: 1,
|
|
|
|
max: 1,
|
|
|
|
max: 1,
|
|
|
|
idleTimeoutMillis: 30000,
|
|
|
|
idleTimeoutMillis: 120 * 1000,
|
|
|
|
|
|
|
|
propagateCreateError: false,
|
|
|
|
|
|
|
|
acquireTimeoutMillis: acquireConnectionTimeout,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
console.log( knexInstance.pool)
|
|
|
|
|
|
|
|
console.log("pool size")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
R.setup(knexInstance);
|
|
|
|
R.setup(knexInstance);
|
|
|
|
|
|
|
|
|
|
|
|
if (process.env.SQL_LOG === "1") {
|
|
|
|
if (process.env.SQL_LOG === "1") {
|
|
|
|