mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-15 08:19:37 +00:00
Update:Remove node-cron dependency
This commit is contained in:
parent
26ef275ab4
commit
b7e546f2f5
19 changed files with 686 additions and 18 deletions
19
server/libs/nodeCron/storage.js
Normal file
19
server/libs/nodeCron/storage.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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;
|
||||
}
|
||||
};
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue