diff --git a/mon-aide-cyber-api/src/infrastructure/entrepots/postgres/knexfile.ts b/mon-aide-cyber-api/src/infrastructure/entrepots/postgres/knexfile.ts index 17251af9b..c99988ded 100644 --- a/mon-aide-cyber-api/src/infrastructure/entrepots/postgres/knexfile.ts +++ b/mon-aide-cyber-api/src/infrastructure/entrepots/postgres/knexfile.ts @@ -1,6 +1,13 @@ export default { client: 'pg', connection: process.env.URL_SERVEUR_BASE_DONNEES!, - pool: { min: 2, max: 10 }, + pool: { + min: process.env.BASE_DE_DONNEES_MIN_POOL + ? parseInt(process.env.BASE_DE_DONNEES_MIN_POOL) + : 2, + max: process.env.BASE_DE_DONNEES_MAX_POOL + ? parseInt(process.env.BASE_DE_DONNEES_MAX_POOL) + : 10, + }, migrations: { tableName: 'knex_migrations' }, }; diff --git a/mon-aide-cyber-api/vitest.config.ts b/mon-aide-cyber-api/vitest.config.ts index e87c6d533..47d04b8f2 100644 --- a/mon-aide-cyber-api/vitest.config.ts +++ b/mon-aide-cyber-api/vitest.config.ts @@ -9,6 +9,8 @@ export default defineProject({ URL_JOURNALISATION_BASE_DONNEES: process.env.URL_JOURNALISATION_BASE_DONNEES || 'postgres://postgres@localhost:5434', + BASE_DE_DONNEES_MIN_POOL: '2', + BASE_DE_DONNEES_MAX_POOL: '50', }, onConsoleLog(log: string): boolean { return !log.includes('Une erreur est survenue:');