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