mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-09-08 19:08:57 +00:00
SeedDMSTask.add() returns taskid, task will be passed to function of task
This commit is contained in:
parent
e87d7546a3
commit
970622564c
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user