Skip to content

Commit

Permalink
[TECHNIQUE] Crée des variables d’environnement pour le pool de la bas…
Browse files Browse the repository at this point in the history
…e de données

Afin d’augmenter le pool maximum dans les tests
  • Loading branch information
bbougon committed Nov 12, 2024
1 parent b916ca6 commit a52b512
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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' },
};
2 changes: 2 additions & 0 deletions mon-aide-cyber-api/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:');
Expand Down

0 comments on commit a52b512

Please sign in to comment.