Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrunk committed Jul 29, 2024
1 parent b11b88d commit 45f4b08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/services/domainService.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ async function generateAndReplaceMainApplicationHaproxyConfig(isGmode = false, t
const updatingConfig = JSON.parse(JSON.stringify(recentlyConfiguredApps));
// merge recentlyConfiguredApps with currently configuredApps
for (const app of configuredApps) {
log.info(`G Updating ${app.name} with IPs ${JSON.stringify(app.ips)}`);
const appExists = updatingConfig.find((a) => a.appName === app.appName);
if (!appExists) {
updatingConfig.push(app);
Expand Down
2 changes: 2 additions & 0 deletions src/services/haproxyTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ async function restartProxy(dataToWrite) {
await writeConfig(TEMP_HAPROXY_CONFIG, dataToWrite);
const isConfigOk = await checkConfig(TEMP_HAPROXY_CONFIG);
if (!isConfigOk) {
log.info('Haproxy config is invalid. Not restarting');
return false;
}
if (lastHaproxyConfig === dataToWrite) {
Expand All @@ -470,6 +471,7 @@ async function restartProxy(dataToWrite) {
await writeConfig(HAPROXY_CONFIG, dataToWrite);
const execHAreload = 'sudo service haproxy reload';
await cmdAsync(execHAreload);
log.info('Haproxy reloaded');
return true;
}

Expand Down

0 comments on commit 45f4b08

Please sign in to comment.