From 26458d99578be0b04840c3ae1cfc555d7539c3c4 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Thu, 25 Jul 2019 06:27:02 +0200 Subject: [PATCH] add pool option to the config --- config/config.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/config/config.js b/config/config.js index 3bb20d6..ea66105 100644 --- a/config/config.js +++ b/config/config.js @@ -1,3 +1,9 @@ +const pool = { + max: parseInt(process.env.DB_POOL_MAX_CONNECTIONS) || 5, + acquire: parseInt(process.env.DB_POOL_ACQUIRE) || 60000, + evict: parseInt(process.env.DB_POOL_EVICT) || 1000, +}; + module.exports = { development: { username: 'docker', @@ -5,14 +11,17 @@ module.exports = { database: 'CrmIntegration', port: '5431', dialect: 'postgres', - logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false + logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false, + pool }, test: { "use_env_variable": 'DATABASE_URL', - logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false + logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false, + pool }, production: { "use_env_variable": 'DATABASE_URL', - logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false + logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false, + pool } };