cron jobs starting

This commit is contained in:
Senad Uka
2017-01-05 15:39:34 +01:00
parent b4da425241
commit 070a1071c9
3 changed files with 36 additions and 1 deletions

View File

@@ -40,5 +40,24 @@ Meteor.zoblak.server = {
result = {}
};
return result;
},
on_all_controllers: function(whatToDo) {
var ids = ControllerState.find({}, {
fields: {
'controller_id': 1
}
}).map(function(cid) {
return cid.controller_id
});
for (var index in ids) {
var controller_id = ids[index];
try {
whatToDo(controller_id);
} catch(err) {
console.log('Cannot call ', whatToDo, controller_id, err);
}
}
}
}