stop previous task explicitly

there is a race:
1. task is running
2. new task is created overwriting the installationState
3. new task kills the old task of step 1. this results in installationState getting overwritten by 'error' because of the sigkill
4. new task that is launched loses the installationState that was step in 2.
This commit is contained in:
girish@cloudron.io
2016-02-09 11:41:59 -08:00
parent 0785266741
commit e6d23a9701
4 changed files with 12 additions and 8 deletions

View File

@@ -763,7 +763,7 @@ function startTask(appId, callback) {
case appdb.ISTATE_PENDING_INSTALL: return install(app, callback);
case appdb.ISTATE_PENDING_FORCE_UPDATE: return update(app, callback);
case appdb.ISTATE_ERROR:
debugApp(app, 'Apptask launched with error states.');
debugApp(app, 'Internal error. apptask launched with error status.');
return callback(null);
default:
debugApp(app, 'apptask launched with invalid command');