refactor(gp connection): added in gp ip into env if not there use static name for dns
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 8m37s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 8m37s
This commit is contained in:
@@ -13,7 +13,9 @@ let attempt = 0;
|
|||||||
const maxAttempts = 10;
|
const maxAttempts = 10;
|
||||||
|
|
||||||
export const connectGPSql = async () => {
|
export const connectGPSql = async () => {
|
||||||
const serverUp = await checkHostnamePort(`USMCD1VMS011:1433`);
|
const serverUp = await checkHostnamePort(
|
||||||
|
`${process.env.GP_SERVER ?? "usmcd1vms011"}:1433`,
|
||||||
|
);
|
||||||
if (!serverUp) {
|
if (!serverUp) {
|
||||||
// we will try to reconnect
|
// we will try to reconnect
|
||||||
connected = false;
|
connected = false;
|
||||||
@@ -119,7 +121,9 @@ export const reconnectToSql = async () => {
|
|||||||
|
|
||||||
await new Promise((res) => setTimeout(res, delayStart));
|
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) {
|
if (!serverUp) {
|
||||||
delayStart = Math.min(delayStart * 2, 30000); // exponential backoff until up to 30000
|
delayStart = Math.min(delayStart * 2, 30000); // exponential backoff until up to 30000
|
||||||
|
|||||||
Reference in New Issue
Block a user