lib/cronJobs/lib/jobManagementDbConnector.js
function () {
        return ServerHeartbeatModel.find({
            status: _statusActive
        }).then(function (cursor) {
            return Q.ninvoke(cursor, 'toArray').then(function (servers) {
                var serverIds = [];
                servers.map(function (value) {
                    serverIds.push(value._id);
                });
                return _removeAllJobsOfUnknownServer(serverIds);
            });
        });
    }
function () {
        return ServerHeartbeatModel.find({
            status: _statusActive
        }).then(function (cursor) {
            return Q.ninvoke(cursor, 'toArray').then(function (servers) {
                var serverIds = [];
                servers.map(function (value) {
                    serverIds.push(value._id);
                });
                return _removeAllJobsOfUnknownServer(serverIds);
            });
        });
    }
function ( ) { return ServerHeartbeatModel . find ( { status : _statusActive } ) . then ( function ( cursor ) { return Q . ninvoke ( cursor , 'toArray' ) . then ( function ( servers ) { var serverIds = [ ] ; servers . map ( function ( value ) { serverIds . push ( value . _id ) ; } ) ; return _removeAllJobsOfUnknownServer ( serverIds ) ; } ) ; } ) ; }
Remove unknown serverIds from jobslist, can happen while server restart
Remove unknown serverIds from jobslist can happen while server restart