Skip to content

Commit

Permalink
fix: allow db_url connect_timeout value to override modparam timeout …
Browse files Browse the repository at this point in the history
…value
  • Loading branch information
NormB committed Aug 2, 2021
1 parent f2860e7 commit 1074fea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/db_postgres/pg_con.c
Expand Up @@ -120,6 +120,11 @@ int db_postgres_connect(struct pg_con* ptr)
}
}

/* force the default timeout */
if (pq_timeout > 0) {
PSQL_PARAM("connect_timeout", int2str(pq_timeout, 0));
}

if (id->parameters) {

lenp = strlen(id->parameters);
Expand Down Expand Up @@ -198,11 +203,6 @@ int db_postgres_connect(struct pg_con* ptr)
LM_DBG("opening connection: postgres://xxxx:xxxx@%s/%s %s\n", ZSW(id->host), ZSW(id->database), ZSW(dbname));
}

/* force the default timeout */
if (pq_timeout > 0) {
PSQL_PARAM("connect_timeout", int2str(pq_timeout, 0));
}

/* End of the parameter list */
PSQL_PARAM(0, 0);

Expand Down

0 comments on commit 1074fea

Please sign in to comment.