From e4aacd8dcba1e69465a123171e9f38fb0bf61a42 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Sun, 31 Dec 2023 03:04:19 +1100 Subject: [PATCH] Add database connection pool --- src/components/DatabaseServer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DatabaseServer.ts b/src/components/DatabaseServer.ts index 031c5bf..2528c66 100644 --- a/src/components/DatabaseServer.ts +++ b/src/components/DatabaseServer.ts @@ -4,7 +4,7 @@ import TSClient from '../helpers/TSClient.js'; const postgresUri = (await TSClient()).postgres_uri; export default class DatabaseServer { - public static seq:Sequelize = new Sequelize(postgresUri, {dialect: 'postgres', logging: false, ssl: false}) + public static seq:Sequelize = new Sequelize(postgresUri, {dialect: 'postgres', logging: false, ssl: false, pool: {max: 10, min: 0, acquire: 15000, idle: 8000}}) public static async init() { try { await this.seq.authenticate();