mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
use new queue
This commit is contained in:
parent
adbf694222
commit
61ba0670f2
@ -30,9 +30,12 @@ class API extends Server {
|
|||||||
limits: {},
|
limits: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
queuesManager = new TaskQueueManager({
|
queuesManager = new TaskQueueManager(
|
||||||
workersPath: `${__dirname}/queues`,
|
{
|
||||||
})
|
workersPath: `${__dirname}/queues`,
|
||||||
|
},
|
||||||
|
this,
|
||||||
|
)
|
||||||
|
|
||||||
async onInitialize() {
|
async onInitialize() {
|
||||||
global.sse = this.contexts.SSEManager
|
global.sse = this.contexts.SSEManager
|
||||||
|
@ -29,7 +29,7 @@ export default {
|
|||||||
transmuxOptions: transmuxOptions,
|
transmuxOptions: transmuxOptions,
|
||||||
cachePath: cachePath,
|
cachePath: cachePath,
|
||||||
onProgress: (progress) => {
|
onProgress: (progress) => {
|
||||||
job.progress(progress)
|
job.updateProgress(progress)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -60,15 +60,21 @@ export default {
|
|||||||
|
|
||||||
if (req.headers["transmux"] || limits.useCompression === true) {
|
if (req.headers["transmux"] || limits.useCompression === true) {
|
||||||
// add a background task
|
// add a background task
|
||||||
const job = await global.queues.createJob("remote_upload", {
|
const job = await global.queues.createJob(
|
||||||
filePath: build.filePath,
|
"remote_upload",
|
||||||
parentDir: req.auth.session.user_id,
|
{
|
||||||
service: limits.useProvider,
|
filePath: build.filePath,
|
||||||
useCompression: limits.useCompression,
|
parentDir: req.auth.session.user_id,
|
||||||
transmux: req.headers["transmux"] ?? false,
|
service: limits.useProvider,
|
||||||
transmuxOptions: req.headers["transmux-options"],
|
useCompression: limits.useCompression,
|
||||||
cachePath: tmpPath,
|
transmux: req.headers["transmux"] ?? false,
|
||||||
})
|
transmuxOptions: req.headers["transmux-options"],
|
||||||
|
cachePath: tmpPath,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
useSSE: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
const sseChannelId = job.sseChannelId
|
const sseChannelId = job.sseChannelId
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user