cron jobs starting
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user