Release 1.5.16

This commit is contained in:
2026-07-26 22:03:36 +01:00
parent 42279d95aa
commit de1469c29d
20 changed files with 679 additions and 242 deletions
+32
View File
@@ -0,0 +1,32 @@
const { registerBackgroundTaskHandlers } = require('./background-task-handlers');
const { registerBackgroundTaskScheduling } = require('./background-task-scheduling');
function createBackgroundTaskSetup(options) {
const pool = options && options.pool;
const common = options && options.common;
const backgroundTaskQueue = options && options.backgroundTaskQueue;
const collectUploadPathsFromDirectory = options && options.collectUploadPathsFromDirectory;
const removeUnusedUploadFiles = options && options.removeUnusedUploadFiles;
const refreshApiSource = options && options.refreshApiSource;
const refreshRssFeed = options && options.refreshRssFeed;
const uploadsDir = String(options && options.uploadsDir || '').trim();
const dataSourceStartupRefreshStaggerMs = Math.max(100, Number(options && options.dataSourceStartupRefreshStaggerMs || 250));
if (!pool || !common || !backgroundTaskQueue || !collectUploadPathsFromDirectory || !removeUnusedUploadFiles || !refreshApiSource || !refreshRssFeed || !uploadsDir) {
throw new Error('createBackgroundTaskSetup requires the background task dependencies.');
}
async function initialize() {
registerBackgroundTaskHandlers(options);
const backgroundTaskScheduling = registerBackgroundTaskScheduling(options);
if (backgroundTaskScheduling && typeof backgroundTaskScheduling.initialize === 'function') {
await backgroundTaskScheduling.initialize();
}
}
return {
initialize: initialize
};
}
module.exports = { createBackgroundTaskSetup };