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

@@ -4,8 +4,7 @@ exports = module.exports = {
sync: sync
};
var appdb = require('./appdb.js'),
apps = require('./apps.js'),
let apps = require('./apps.js'),
assert = require('assert'),
async = require('async'),
constants = require('./constants.js'),
@@ -149,7 +148,7 @@ function runTask(appId, taskName, callback) {
apps.get(appId, function (error, app) {
if (error) return callback(error);
if (app.installationState !== appdb.ISTATE_INSTALLED || app.runState !== appdb.RSTATE_RUNNING || app.health !== appdb.HEALTH_HEALTHY) {
if (app.installationState !== apps.ISTATE_INSTALLED || app.runState !== apps.RSTATE_RUNNING || app.health !== apps.HEALTH_HEALTHY) {
debug(`runTask: skipped task ${taskName} because app ${app.fqdn} has run state ${app.installationState}`);
return callback();
}