Skip to content

Commit

Permalink
test no ips on configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Cabecinha84 committed Jul 29, 2024
1 parent 45f4b08 commit 499842c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/services/domainService.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async function selectIPforG(ips, app) {
async function generateAndReplaceMainApplicationHaproxyConfig(isGmode = false, timeout = 30) {
try {
if (isGmode) {
log.info('G Mode STARTED at' + new Date());
log.info(`G Mode STARTED at${new Date()}`);
if (!recentlyConfiguredApps) {
throw new Error('G Mode is awaiting processing');
}
Expand Down Expand Up @@ -585,6 +585,9 @@ async function generateAndReplaceMainApplicationHaproxyConfig(isGmode = false, t
const appExists = updatingConfig.find((a) => a.appName === app.appName);
if (!appExists) {
updatingConfig.push(app);
} else if (!app.ips) {
// replace this element with new
updatingConfig.splice(updatingConfig.indexOf(appExists), 1);
} else {
// replace this element with new
updatingConfig.splice(updatingConfig.indexOf(appExists), 1, app);
Expand Down Expand Up @@ -616,7 +619,7 @@ async function generateAndReplaceMainApplicationHaproxyConfig(isGmode = false, t
log.error(error);
} finally {
if (isGmode) {
log.info('G Mode ENDED at' + new Date());
log.info(`G Mode ENDED at${new Date()}`);
}
setTimeout(() => {
generateAndReplaceMainApplicationHaproxyConfig(isGmode, timeout);
Expand Down

0 comments on commit 499842c

Please sign in to comment.