Better pending state check
This commit is contained in:
@@ -90,8 +90,9 @@ function resumeTasks(callback) {
|
||||
if (error) return callback(error);
|
||||
|
||||
result.forEach(function (app) {
|
||||
if (app.installationState === apps.ISTATE_INSTALLED && (app.runState === apps.RSTATE_RUNNING || app.runState === apps.RSTATE_STOPPED)) return;
|
||||
if (app.installationState === apps.ISTATE_ERROR) return;
|
||||
// if not in any pending state, do nothing
|
||||
if (app.installationState === apps.ISTATE_INSTALLED || app.installationState === apps.ISTATE_ERROR) return;
|
||||
if (app.runState === apps.RSTATE_RUNNING || app.runState === apps.RSTATE_STOPPED) return;
|
||||
|
||||
debug(`resumeTask: schedule task for ${app.fqdn} ${app.id}: state=${app.installationState},taskId=${app.taskId}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user