From c634bdbd34f323901242ff9b9236b54e711b5921 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 11 Mar 2024 23:34:03 +0100 Subject: [PATCH] scheduler: do not create jobs of suspended apps otherwise, when an app is uninstalling, it creates the docker containers by calling getDynamicEnvironment. This ends up adding addonConfigs for the docker addon and prevents the app from getting uninstalled. --- src/scheduler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scheduler.js b/src/scheduler.js index 85a284629..96ca4c49a 100644 --- a/src/scheduler.js +++ b/src/scheduler.js @@ -136,7 +136,7 @@ async function sync() { if (_.isEqual(appState.schedulerConfig, schedulerConfig) && appState.containerId === app.containerId) continue; // nothing changed } - debug(`sync: adding jobs of ${app.id} (${app.fqdn})`); + debug(`sync: clearing jobs of ${app.id} (${app.fqdn})`); const [error] = await safe(stopJobs(app.id, appState)); if (error) debug(`sync: error stopping jobs of ${app.id} : ${error.message}`); @@ -146,6 +146,8 @@ async function sync() { continue; } + if (gSuspendedAppIds.has(app.d)) continue; // do not create jobs of suspended apps + const cronJobs = await createJobs(app, schedulerConfig); // if docker is down, the next sync() will recreate everything for this app gState[app.id] = { containerId: app.containerId, schedulerConfig, cronJobs }; }