Make tasks indexed by id instead of type

The caas migrate logic is broken at this point until it uses new
task framework
This commit is contained in:
Girish Ramakrishnan
2018-12-08 18:50:06 -08:00
parent cfb68a0511
commit d8225ad653
12 changed files with 174 additions and 107 deletions

View File

@@ -65,12 +65,12 @@ function getDisks(req, res, next) {
function update(req, res, next) {
// this only initiates the update, progress can be checked via the progress route
updater.updateToLatest(auditSource(req), function (error) {
updater.updateToLatest(auditSource(req), function (error, taskId) {
if (error && error.reason === UpdaterError.ALREADY_UPTODATE) return next(new HttpError(422, error.message));
if (error && error.reason === UpdaterError.BAD_STATE) return next(new HttpError(409, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202, {}));
next(new HttpSuccess(202, { taskId }));
});
}