add an REST API to trigger the prune trash job

This commit is contained in:
Hongbo Wu
2024-06-13 14:48:14 +08:00
parent 30adbb735f
commit 9ef91ff1ca
6 changed files with 50 additions and 69 deletions

View File

@ -216,7 +216,7 @@ export const createWorker = (connection: ConnectionOptions) =>
case GENERATE_PREVIEW_CONTENT_JOB:
return generatePreviewContent(job.data)
case PRUNE_TRASH_JOB:
return pruneTrashJob()
return pruneTrashJob(job.data)
default:
logger.warning(`[queue-processor] unhandled job: ${job.name}`)
}
@ -251,18 +251,6 @@ const setupCronJobs = async () => {
},
}
)
await queue.add(
PRUNE_TRASH_JOB,
{},
{
priority: getJobPriority(PRUNE_TRASH_JOB),
repeat: {
// daily at 3am
pattern: '0 3 * * *',
},
}
)
}
const main = async () => {