Run jobs only once at a time. Start an task api.
This commit is contained in:
parent
5ff76db5a9
commit
638cc94db3
9 changed files with 99 additions and 7 deletions
server/resources
21
server/resources/taskResource.js
Normal file
21
server/resources/taskResource.js
Normal 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()
|
||||
};
|
||||
}));
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue