SeedDMSTask.add() returns taskid, task will be passed to function of task

This commit is contained in:
Uwe Steinmann 2023-01-26 13:19:28 +01:00
parent e87d7546a3
commit 970622564c
2 changed files with 4 additions and 4 deletions

View File

@ -1407,14 +1407,14 @@ $(document).ready(function() { /* {{{ */
); );
SeedDMSTask.add = function(task) { SeedDMSTask.add = function(task) {
tasks.push(task); return tasks.push(task);
} }
SeedDMSTask.run = function() { SeedDMSTask.run = function() {
for(let task of tasks) { for(let task of tasks) {
if(counter % task.interval == 0) { if(counter % task.interval == 0) {
// console.log("Running task '" + task.name + "'"); // console.log("Running task '" + task.name + "'");
task.func(); task.func(task);
} }
} }
//console.log(counter); //console.log(counter);

View File

@ -1463,14 +1463,14 @@ $(document).ready(function() { /* {{{ */
); );
SeedDMSTask.add = function(task) { SeedDMSTask.add = function(task) {
tasks.push(task); return tasks.push(task);
} }
SeedDMSTask.run = function() { SeedDMSTask.run = function() {
for(let task of tasks) { for(let task of tasks) {
if(counter % task.interval == 0) { if(counter % task.interval == 0) {
// console.log("Running task '" + task.name + "'"); // console.log("Running task '" + task.name + "'");
task.func(); task.func(task);
} }
} }
//console.log(counter); //console.log(counter);