Skip to content

Commit c05d7d0

Browse files
committed
chore: bunp connection pool size
1 parent ac7e62e commit c05d7d0

12 files changed

Lines changed: 101 additions & 0 deletions

File tree

infrastructure/evault-core/src/config/database.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,12 @@ export const AppDataSource = new DataSource({
2121
ca: process.env.DB_CA_CERT,
2222
}
2323
: false,
24+
// Connection pool configuration to prevent exhaustion
25+
extra: {
26+
max: 10,
27+
min: 2,
28+
idleTimeoutMillis: 30000,
29+
connectionTimeoutMillis: 5000,
30+
statement_timeout: 10000,
31+
},
2432
})

platforms/cerberus/src/database/data-source.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,18 @@ export const AppDataSource = new DataSource({
3434
ca: process.env.DB_CA_CERT,
3535
}
3636
: false,
37+
// Connection pool configuration to prevent exhaustion
38+
extra: {
39+
// Maximum number of connections in pool
40+
max: 10,
41+
// Minimum number of connections in pool
42+
min: 2,
43+
// Maximum time (ms) a connection can be idle before being released
44+
idleTimeoutMillis: 30000,
45+
// Maximum time (ms) to wait for a connection from pool
46+
connectionTimeoutMillis: 5000,
47+
// Query timeout (ms) - fail queries that take too long
48+
statement_timeout: 10000,
49+
},
3750
});
3851

platforms/dreamsync-api/src/database/data-source.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ export const dataSourceOptions: DataSourceOptions = {
3030
ca: process.env.DB_CA_CERT,
3131
}
3232
: false,
33+
// Connection pool configuration to prevent exhaustion
34+
extra: {
35+
max: 10,
36+
min: 2,
37+
idleTimeoutMillis: 30000,
38+
connectionTimeoutMillis: 5000,
39+
statement_timeout: 10000,
40+
},
3341
};
3442

3543
export const AppDataSource = new DataSource(dataSourceOptions);

platforms/eCurrency-api/src/database/data-source.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ export const dataSourceOptions: DataSourceOptions = {
2222
migrations: [path.join(__dirname, "migrations", "*.ts")],
2323
logging: process.env.NODE_ENV === "development",
2424
subscribers: [PostgresSubscriber],
25+
// Connection pool configuration to prevent exhaustion
26+
extra: {
27+
max: 10,
28+
min: 2,
29+
idleTimeoutMillis: 30000,
30+
connectionTimeoutMillis: 5000,
31+
statement_timeout: 10000,
32+
},
2533
};
2634

2735
export const AppDataSource = new DataSource(dataSourceOptions);

platforms/eReputation-api/src/database/data-source.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ export const dataSourceOptions: DataSourceOptions = {
2626
migrations: [path.join(__dirname, "migrations", "*.ts")],
2727
logging: process.env.NODE_ENV === "development",
2828
subscribers: [PostgresSubscriber],
29+
// Connection pool configuration to prevent exhaustion
30+
extra: {
31+
max: 10,
32+
min: 2,
33+
idleTimeoutMillis: 30000,
34+
connectionTimeoutMillis: 5000,
35+
statement_timeout: 10000,
36+
},
2937
};
3038

3139
export const AppDataSource = new DataSource(dataSourceOptions);

platforms/emover-api/src/database/data-source.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ export const dataSourceOptions: DataSourceOptions = {
2020
ca: process.env.DB_CA_CERT,
2121
}
2222
: false,
23+
// Connection pool configuration to prevent exhaustion
24+
extra: {
25+
max: 10,
26+
min: 2,
27+
idleTimeoutMillis: 30000,
28+
connectionTimeoutMillis: 5000,
29+
statement_timeout: 10000,
30+
},
2331
};
2432

2533
export const AppDataSource = new DataSource(dataSourceOptions);

platforms/esigner-api/src/database/data-source.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ export const AppDataSource = new DataSource({
2727
ca: process.env.DB_CA_CERT,
2828
}
2929
: false,
30+
// Connection pool configuration to prevent exhaustion
31+
extra: {
32+
max: 10,
33+
min: 2,
34+
idleTimeoutMillis: 30000,
35+
connectionTimeoutMillis: 5000,
36+
statement_timeout: 10000,
37+
},
3038
});
3139

3240

platforms/evoting-api/src/database/data-source.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ export const dataSourceOptions: DataSourceOptions = {
2929
ca: process.env.DB_CA_CERT,
3030
}
3131
: false,
32+
// Connection pool configuration to prevent exhaustion
33+
extra: {
34+
max: 10,
35+
min: 2,
36+
idleTimeoutMillis: 30000,
37+
connectionTimeoutMillis: 5000,
38+
statement_timeout: 10000,
39+
},
3240
};
3341

3442
export const AppDataSource = new DataSource(dataSourceOptions);

platforms/file-manager-api/src/database/data-source.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,13 @@ export const AppDataSource = new DataSource({
4141
ca: process.env.DB_CA_CERT,
4242
}
4343
: false,
44+
// Connection pool configuration to prevent exhaustion
45+
extra: {
46+
max: 10,
47+
min: 2,
48+
idleTimeoutMillis: 30000,
49+
connectionTimeoutMillis: 5000,
50+
statement_timeout: 10000,
51+
},
4452
});
4553

platforms/group-charter-manager-api/src/database/data-source.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,12 @@ export const AppDataSource = new DataSource({
2424
ca: process.env.DB_CA_CERT,
2525
}
2626
: false,
27+
// Connection pool configuration to prevent exhaustion
28+
extra: {
29+
max: 10,
30+
min: 2,
31+
idleTimeoutMillis: 30000,
32+
connectionTimeoutMillis: 5000,
33+
statement_timeout: 10000,
34+
},
2735
});

0 commit comments

Comments
 (0)