Run jobs only once at a time. Start an task api.

This commit is contained in:
baldo 2016-06-03 23:42:17 +02:00
parent 5ff76db5a9
commit 638cc94db3
9 changed files with 99 additions and 7 deletions
server/resources

View file

@ -0,0 +1,21 @@
'use strict';
angular.module('ffffng').factory('TaskResource', function (
_,
Resources,
Scheduler
) {
return {
getAll: function (req, res) {
var tasks = Scheduler.getTasks();
return Resources.success(res, _.map(tasks, function (task) {
return {
name: task.name,
schedule: task.schedule,
runningSince: task.runningSince && task.runningSince.unix(),
lastRunStarted: task.lastRunStarted && task.lastRunStarted.unix()
};
}));
}
};
});