Skip to content

Commit

Permalink
fix: error retrieving keep alive settings
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc-bq committed Feb 3, 2025
1 parent 2aa927f commit c572332
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mysql/lib/dialect/mysql2_driver_dialect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class MySQL2DriverDialect implements DriverDialect {
}

setKeepAliveProperties(props: Map<string, any>, keepAliveProps: any) {
if (keepAliveProps && keepAliveProps.get(MySQL2DriverDialect.KEEP_ALIVE_PROPERTY_NAME)) {
if (keepAliveProps && keepAliveProps[MySQL2DriverDialect.KEEP_ALIVE_PROPERTY_NAME] !== undefined) {
throw new UnsupportedMethodError("Keep alive configuration is not supported for MySQL2.");
}
}
Expand Down
8 changes: 4 additions & 4 deletions pg/lib/dialect/node_postgres_driver_dialect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ export class NodePostgresDriverDialect implements DriverDialect {
return;
}

const keepAlive = keepAliveProps.get(NodePostgresDriverDialect.KEEP_ALIVE_PROPERTY_NAME);
const keepAliveInitialDelayMillis = keepAliveProps.get(NodePostgresDriverDialect.KEEP_ALIVE_INITIAL_DELAY_MILLIS_PROPERTY_NAME);
const keepAlive = keepAliveProps[NodePostgresDriverDialect.KEEP_ALIVE_PROPERTY_NAME];
const keepAliveInitialDelayMillis = keepAliveProps[NodePostgresDriverDialect.KEEP_ALIVE_INITIAL_DELAY_MILLIS_PROPERTY_NAME];

if (keepAlive) {
if (keepAlive !== undefined) {
props.set(NodePostgresDriverDialect.KEEP_ALIVE_PROPERTY_NAME, keepAlive);
}
if (keepAliveInitialDelayMillis) {
if (keepAliveInitialDelayMillis !== undefined) {
props.set(NodePostgresDriverDialect.KEEP_ALIVE_INITIAL_DELAY_MILLIS_PROPERTY_NAME, keepAliveInitialDelayMillis);
}
}
Expand Down

0 comments on commit c572332

Please sign in to comment.