Move state enums to the model code

This commit is contained in:
Girish Ramakrishnan
2019-08-30 13:12:49 -07:00
parent b4cbf63519
commit dd0fb8292c
15 changed files with 118 additions and 156 deletions

View File

@@ -5,8 +5,7 @@ exports = module.exports = {
scheduleTask: scheduleTask
};
var appdb = require('./appdb.js'),
apps = require('./apps.js'),
let apps = require('./apps.js'),
assert = require('assert'),
debug = require('debug')('box:taskmanager'),
fs = require('fs'),
@@ -91,8 +90,8 @@ function resumeTasks(callback) {
if (error) return callback(error);
result.forEach(function (app) {
if (app.installationState === appdb.ISTATE_INSTALLED && app.runState === appdb.RSTATE_RUNNING) return;
if (app.installationState === appdb.ISTATE_ERROR) return;
if (app.installationState === apps.ISTATE_INSTALLED && app.runState === apps.RSTATE_RUNNING) return;
if (app.installationState === apps.ISTATE_ERROR) return;
debug(`resumeTask: starting app task for ${app.fqdn} ${app.id} and state ${app.installationState}`);