Skip to content

Commit 2794be1

Browse files
Added a fix for POSTGRES_CONNECTION_STRING_PATH handling
Signed-off-by: Aayush Chouhan <[email protected]>
1 parent 0bf3bf6 commit 2794be1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/util/postgres_client.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,10 +1498,13 @@ class PostgresClient extends EventEmitter {
14981498
};
14991499

15001500

1501-
if (process.env.POSTGRES_CONNECTION_STRING_PATH) {
1501+
const connection_string = process.env.POSTGRES_CONNECTION_STRING ||
1502+
fs_utils.try_read_file_sync(process.env.POSTGRES_CONNECTION_STRING_PATH);
1503+
1504+
if (connection_string) {
15021505
/** @type {import('pg').PoolConfig} */
15031506
this.new_pool_params = {
1504-
connectionString: fs.readFileSync(process.env.POSTGRES_CONNECTION_STRING_PATH, "utf8"),
1507+
connectionString: connection_string,
15051508
...params,
15061509
};
15071510
} else {

0 commit comments

Comments
 (0)