use new queue

This commit is contained in:
SrGooglo 2025-02-25 23:09:38 +00:00
parent adbf694222
commit 61ba0670f2
3 changed files with 22 additions and 13 deletions

View File

@ -30,9 +30,12 @@ class API extends Server {
limits: {},
}
queuesManager = new TaskQueueManager({
queuesManager = new TaskQueueManager(
{
workersPath: `${__dirname}/queues`,
})
},
this,
)
async onInitialize() {
global.sse = this.contexts.SSEManager

View File

@ -29,7 +29,7 @@ export default {
transmuxOptions: transmuxOptions,
cachePath: cachePath,
onProgress: (progress) => {
job.progress(progress)
job.updateProgress(progress)
},
})

View File

@ -60,7 +60,9 @@ export default {
if (req.headers["transmux"] || limits.useCompression === true) {
// add a background task
const job = await global.queues.createJob("remote_upload", {
const job = await global.queues.createJob(
"remote_upload",
{
filePath: build.filePath,
parentDir: req.auth.session.user_id,
service: limits.useProvider,
@ -68,7 +70,11 @@ export default {
transmux: req.headers["transmux"] ?? false,
transmuxOptions: req.headers["transmux-options"],
cachePath: tmpPath,
})
},
{
useSSE: true,
},
)
const sseChannelId = job.sseChannelId