restartAppTask when resuming tasks

We end up with duplicate tasks because the auto installer might
have queued up some pending_install tasks on start up.
This commit is contained in:
Girish Ramakrishnan
2016-06-21 10:56:23 -05:00
parent 5a61c5ba51
commit ffc5faee6e

View File

@@ -80,7 +80,7 @@ function platformReady() {
}
}
// resume app installs and uninstalls
// resume app tasks when platform is ready or after a crash
function resumeTasks(callback) {
callback = callback || NOOP_CALLBACK;
@@ -95,7 +95,7 @@ function resumeTasks(callback) {
if (app.installationState === appdb.ISTATE_ERROR) return;
debug('Creating process for %s (%s) with state %s', app.location, app.id, app.installationState);
startAppTask(app.id, NOOP_CALLBACK);
restartAppTask(app.id, NOOP_CALLBACK); // restart because the auto-installer could have queued up tasks already
});
callback(null);