1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 04:10:59 -05:00

Add database connection pool

This commit is contained in:
toast-ts 2023-12-31 03:04:19 +11:00
parent 4a29ccf97f
commit e4aacd8dcb

View File

@ -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();