Skip to content

Commit

Permalink
fix: setQueryTimeout for mysql2DriverDialect
Browse files Browse the repository at this point in the history
  • Loading branch information
joyc-bq committed Feb 3, 2025
1 parent 2aa927f commit 3e99bf0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/lib/mysql_client_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class MySQLClientWrapper implements ClientWrapper {
}

query(sql: any): Promise<any> {
this.driverDialect.setQueryTimeout(this.properties, sql);
this.driverDialect.setQueryTimeout(this.properties);
return this.client?.query(sql);
}

Expand Down
8 changes: 4 additions & 4 deletions mysql/lib/dialect/mysql2_driver_dialect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ export class MySQL2DriverDialect implements DriverDialect {
}
}

setQueryTimeout(props: Map<string, any>, sql?: any, wrapperConnectTimeout?: any) {
const timeout = wrapperConnectTimeout ?? props.get(WrapperProperties.WRAPPER_QUERY_TIMEOUT.name);
if (timeout && !sql[MySQL2DriverDialect.QUERY_TIMEOUT_PROPERTY_NAME]) {
sql[MySQL2DriverDialect.QUERY_TIMEOUT_PROPERTY_NAME] = timeout;
setQueryTimeout(props: Map<string, any>, wrapperQueryTimeout?: any) {
const timeout = wrapperQueryTimeout ?? props.get(WrapperProperties.WRAPPER_QUERY_TIMEOUT.name);
if (timeout) {
props.set(MySQL2DriverDialect.QUERY_TIMEOUT_PROPERTY_NAME, timeout);
}
}

Expand Down
2 changes: 1 addition & 1 deletion pg/lib/dialect/node_postgres_driver_dialect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class NodePostgresDriverDialect implements DriverDialect {
}
}

setQueryTimeout(props: Map<string, any>, sql?: any, wrapperQueryTimeout?: any) {
setQueryTimeout(props: Map<string, any>, wrapperQueryTimeout?: any) {
const timeout = wrapperQueryTimeout ?? props.get(WrapperProperties.WRAPPER_QUERY_TIMEOUT.name);
if (timeout) {
props.set(NodePostgresDriverDialect.QUERY_TIMEOUT_PROPERTY_NAME, timeout);
Expand Down

0 comments on commit 3e99bf0

Please sign in to comment.