From 36995e9fb42cfa1b72c096b8860866d70b86e70c Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Tue, 5 May 2026 13:15:52 -0500 Subject: [PATCH] refactor(gp connection): added in gp ip into env if not there use static name for dns --- backend/gpSql/gpSqlConnection.controller.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/gpSql/gpSqlConnection.controller.ts b/backend/gpSql/gpSqlConnection.controller.ts index 7f34d45..2b8ec8a 100644 --- a/backend/gpSql/gpSqlConnection.controller.ts +++ b/backend/gpSql/gpSqlConnection.controller.ts @@ -13,7 +13,9 @@ let attempt = 0; const maxAttempts = 10; export const connectGPSql = async () => { - const serverUp = await checkHostnamePort(`USMCD1VMS011:1433`); + const serverUp = await checkHostnamePort( + `${process.env.GP_SERVER ?? "usmcd1vms011"}:1433`, + ); if (!serverUp) { // we will try to reconnect connected = false; @@ -119,7 +121,9 @@ export const reconnectToSql = async () => { await new Promise((res) => setTimeout(res, delayStart)); - const serverUp = await checkHostnamePort(`${process.env.PROD_SERVER}:1433`); + const serverUp = await checkHostnamePort( + `${process.env.GP_SERVER ?? "usmcd1vms011"}:1433`, + ); if (!serverUp) { delayStart = Math.min(delayStart * 2, 30000); // exponential backoff until up to 30000