You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
489 B
19 lines
489 B
module.exports = (() => {
|
|
if(!global.scheduledTasks){
|
|
global.scheduledTasks = new Map();
|
|
}
|
|
|
|
return {
|
|
save: (task) => {
|
|
if(!task.options){
|
|
const uuid = require('uuid');
|
|
task.options = {};
|
|
task.options.name = uuid.v4();
|
|
}
|
|
global.scheduledTasks.set(task.options.name, task);
|
|
},
|
|
getTasks: () => {
|
|
return global.scheduledTasks;
|
|
}
|
|
};
|
|
})(); |