mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-30 18:48:55 +01:00
19 lines
489 B
JavaScript
19 lines
489 B
JavaScript
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;
|
|
}
|
|
};
|
|
})(); |