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.
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user