[object Object]

← back to Fentucci Naturals

TK-11438: migrate postgres pool to unix socket (darwin fallback)

7ad86d7e23b425919edffdcbaae30430dcf5406e · 2026-09-15 04:07:21 -0700 · steve@designerwallcoverings.com

Use process.env.PGHOST || darwin?/tmp:127.0.0.1 so Mac2 services use the
unix socket at /tmp and Kamatera keeps TCP until its own migration.
Undo: git revert HEAD

Files touched

Diff

commit 7ad86d7e23b425919edffdcbaae30430dcf5406e
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date:   Tue Sep 15 04:07:21 2026 -0700

    TK-11438: migrate postgres pool to unix socket (darwin fallback)
    
    Use process.env.PGHOST || darwin?/tmp:127.0.0.1 so Mac2 services use the
    unix socket at /tmp and Kamatera keeps TCP until its own migration.
    Undo: git revert HEAD
---
 lib/vendor-requests.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vendor-requests.js b/lib/vendor-requests.js
index cdf81fe..33f6eaf 100644
--- a/lib/vendor-requests.js
+++ b/lib/vendor-requests.js
@@ -49,7 +49,7 @@ const GEORGE_AUTH = firstEnv('GEORGE_BASIC_AUTH', GEORGE_ENVS) || 'admin:';
 
 let pool = null;
 function db() {
-  if (!pool) pool = new Pool({ host: '127.0.0.1', port: 5432, user: 'dw_admin', database: 'dw_unified', password: PGPASS, max: 3 });
+  if (!pool) pool = new Pool({ host: process.env.PGHOST || (process.platform === 'darwin' ? '/tmp' : '127.0.0.1'), port: 5432, user: 'dw_admin', database: 'dw_unified', password: PGPASS, max: 3 });
   return pool;
 }
 

← 46f9c5c TK-11664 Option B: codify Sample qty=2026+tracked carve-out  ·  back to Fentucci Naturals  ·  auto-data-snapshot: 2026-09-17T14:12:57 (1 data files) — dat 8805ceb →