Added API call to run task immediately.

This commit is contained in:
baldo 2016-06-04 11:41:57 +02:00
parent 638cc94db3
commit bee528f1b8
4 changed files with 48 additions and 10 deletions
server/jobs

View file

@ -38,7 +38,7 @@ angular.module('ffffng').factory('Scheduler', function ($injector, Logger, confi
lastRunStarted: false
};
cron.schedule(expr, function () {
task.run = function () {
if (task.runningSince) {
// job is still running, skip execution
return;
@ -50,7 +50,9 @@ angular.module('ffffng').factory('Scheduler', function ($injector, Logger, confi
job.run(function () {
task.runningSince = false;
});
});
};
cron.schedule(expr, task.run);
tasks['' + id] = task;
}