Skip to content

Commit

Permalink
adjust sending messages depending if node is confirmed or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Cabecinha84 committed Oct 29, 2024
1 parent a5ce48a commit f7ebc78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ZelBack/src/services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -13188,13 +13188,14 @@ async function monitorNodeStatus() {
if (installedAppsRes.status !== 'success') {
throw new Error('monitorNodeStatus - Failed to get installed Apps');
}
const isNodeConfirmed = await generalService.isNodeStatusConfirmed();
const appsInstalled = installedAppsRes.data;
// eslint-disable-next-line no-restricted-syntax
for (const installedApp of appsInstalled) {
log.info(`monitorNodeStatus - Application ${installedApp.name} going to be removed from node as the node have DOS state over 100`);
log.warn(`monitorNodeStatus - Removing application ${installedApp.name} locally`);
// eslint-disable-next-line no-await-in-loop
await removeAppLocally(installedApp.name, null, true, false, false);
await removeAppLocally(installedApp.name, null, true, false, isNodeConfirmed);
log.warn(`monitorNodeStatus - Application ${installedApp.name} locally removed`);
// eslint-disable-next-line no-await-in-loop
await serviceHelper.delay(60 * 1000); // wait for 1 min between each removal
Expand Down

0 comments on commit f7ebc78

Please sign in to comment.