Fix crash when resuming stopped apps
This commit is contained in:
@@ -7,7 +7,7 @@ exports = module.exports = {
|
||||
|
||||
let apps = require('./apps.js'),
|
||||
assert = require('assert'),
|
||||
debug = require('debug')('box:taskmanager'),
|
||||
debug = require('debug')('box:apptaskmanager'),
|
||||
fs = require('fs'),
|
||||
locker = require('./locker.js'),
|
||||
safe = require('safetydance'),
|
||||
@@ -90,7 +90,7 @@ function resumeTasks(callback) {
|
||||
if (error) return callback(error);
|
||||
|
||||
result.forEach(function (app) {
|
||||
if (app.installationState === apps.ISTATE_INSTALLED && app.runState === apps.RSTATE_RUNNING) return;
|
||||
if (app.installationState === apps.ISTATE_INSTALLED && (app.runState === apps.RSTATE_RUNNING || app.runState === apps.RSTATE_STOPPED)) return;
|
||||
if (app.installationState === apps.ISTATE_ERROR) return;
|
||||
|
||||
debug(`resumeTask: schedule task for ${app.fqdn} ${app.id}: state=${app.installationState},taskId=${app.taskId}`);
|
||||
|
||||
Reference in New Issue
Block a user