Skip to content

Commit 9058108

Browse files
committed
feat(scripts): Honor PGHOST for unix-socket DB connections
1 parent 4d75d8d commit 9058108

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/poll-feeds.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ async function main() {
277277
throw new Error('DATABASE_URL required');
278278
}
279279

280-
const sql = postgres(connectionString, { max: 20, idle_timeout: 20 });
280+
const sql = postgres(connectionString, { max: 20, idle_timeout: 20, ...(process.env.PGHOST && { host: process.env.PGHOST }) });
281281

282282
if (DAEMON_MODE) {
283283
console.log(

scripts/poll-top-charts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ async function main() {
329329
throw new Error('DATABASE_URL required');
330330
}
331331

332-
const sql = postgres(connectionString, { max: 20, idle_timeout: 20 });
332+
const sql = postgres(connectionString, { max: 20, idle_timeout: 20, ...(process.env.PGHOST && { host: process.env.PGHOST }) });
333333

334334
const locales = DEFAULT_LOCALES;
335335

0 commit comments

Comments
 (0)