Use business logic for getting all apps in taskmanager
This commit is contained in:
+3
-3
@@ -13,6 +13,7 @@ exports = module.exports = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var appdb = require('./appdb.js'),
|
var appdb = require('./appdb.js'),
|
||||||
|
apps = require('./apps.js'),
|
||||||
assert = require('assert'),
|
assert = require('assert'),
|
||||||
async = require('async'),
|
async = require('async'),
|
||||||
child_process = require('child_process'),
|
child_process = require('child_process'),
|
||||||
@@ -43,12 +44,11 @@ function resumeTasks(callback) {
|
|||||||
|
|
||||||
gPaused = false;
|
gPaused = false;
|
||||||
|
|
||||||
appdb.getAll(function (error, apps) {
|
apps.getAll(function (error, result) {
|
||||||
if (error) return callback(error);
|
if (error) return callback(error);
|
||||||
|
|
||||||
apps.forEach(function (app) {
|
result.forEach(function (app) {
|
||||||
if (app.installationState === appdb.ISTATE_INSTALLED && app.runState === appdb.RSTATE_RUNNING) return;
|
if (app.installationState === appdb.ISTATE_INSTALLED && app.runState === appdb.RSTATE_RUNNING) return;
|
||||||
|
|
||||||
if (app.installationState === appdb.ISTATE_ERROR) return;
|
if (app.installationState === appdb.ISTATE_ERROR) return;
|
||||||
|
|
||||||
debug('Creating process for %s (%s) with state %s', app.fqdn, app.id, app.installationState);
|
debug('Creating process for %s (%s) with state %s', app.fqdn, app.id, app.installationState);
|
||||||
|
|||||||
Reference in New Issue
Block a user