Skip to content

Commit a8f5b32

Browse files
committed
feat: add env for use_pool
1 parent b52dca6 commit a8f5b32

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/config/rds.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export default {
1919
queueLimit: Number(
2020
process.env.LESGO_AWS_RDS_AURORA_MYSQL_PROXY_QUEUE_LIMIT || '0'
2121
),
22+
usePool:
23+
process.env.LESGO_AWS_RDS_AURORA_MYSQL_USE_POOL === 'false'
24+
? false
25+
: true,
2226
},
2327
},
2428
},

src/services/RDSAuroraMySQLProxyService/getMySQLProxyClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const getMySQLProxyClient = async (
3636
rdsConfig.aurora.mysql.proxy.dbCredentialsSecretId) as string;
3737
const databaseName =
3838
options.databaseName || rdsConfig.aurora.mysql.databaseName;
39-
const usePool = options.usePool ?? true;
39+
const usePool = options.usePool ?? rdsConfig.aurora.mysql.usePool;
4040

4141
if (!isEmpty(singleton[singletonConn])) {
4242
logger.debug(`${FILE}::REUSE_RDS_CONNECTION`);

0 commit comments

Comments
 (0)