[object Object]

← back to Vendor Recrawl Dispatcher

auto-data-snapshot: 2026-09-17T17:25:36 (1 data files) — lib/db.js.bak-tk11438

915e3f93f632242da08d967ee958c7bcc9e6d3ce · 2026-09-17 17:26:36 -0700 · auto-commit-fleet

Files touched

Diff

commit 915e3f93f632242da08d967ee958c7bcc9e6d3ce
Author: auto-commit-fleet <steve@designerwallcoverings.com>
Date:   Thu Sep 17 17:26:36 2026 -0700

    auto-data-snapshot: 2026-09-17T17:25:36 (1 data files) — lib/db.js.bak-tk11438
---
 lib/db.js.bak-tk11438 | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/lib/db.js.bak-tk11438 b/lib/db.js.bak-tk11438
new file mode 100644
index 0000000..3d17b22
--- /dev/null
+++ b/lib/db.js.bak-tk11438
@@ -0,0 +1,27 @@
+'use strict';
+// Postgres pool for the LOCAL dw_unified mirror on mac3.
+// Reads DATABASE_URL from the DW ImportNewSkufromURL/.env.local; falls back to a
+// trust-auth local connection string (dw_admin connects without a password locally).
+const fs = require('fs');
+const { Pool } = require('pg');
+const cfg = require('./config');
+
+function loadDbUrl() {
+  if (process.env.DATABASE_URL) return process.env.DATABASE_URL;
+  try {
+    const txt = fs.readFileSync(cfg.DB_ENV_FILE, 'utf8');
+    const m = txt.match(/^DATABASE_URL=(.+)$/m);
+    if (m) return m[1].trim();
+  } catch (_) { /* fall through */ }
+  // trust-auth fallback (verified: local dw_admin needs no password)
+  return 'postgresql://dw_admin@127.0.0.1:5432/dw_unified';
+}
+
+const pool = new Pool({
+  connectionString: loadDbUrl(),
+  max: 4,
+  connectionTimeoutMillis: 5000,
+  idleTimeoutMillis: 10000,
+});
+
+module.exports = { pool };

← cef3bc4 TK-11438: migrate pg fallback to unix socket (?host=/tmp) —  ·  back to Vendor Recrawl Dispatcher  ·  (newest)