Added API call to run task immediately.
This commit is contained in:
parent
638cc94db3
commit
bee528f1b8
4 changed files with 48 additions and 10 deletions
server/jobs
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue