🤐 Added uncompression event
This commit is contained in:
@@ -352,6 +352,17 @@ export default class JobQueueService extends Service {
|
|||||||
console.log(
|
console.log(
|
||||||
`Uncompression Job ID ${ctx.params.id} completed.`
|
`Uncompression Job ID ${ctx.params.id} completed.`
|
||||||
);
|
);
|
||||||
|
const job = await this.job(ctx.params.id);
|
||||||
|
await this.broker.call("socket.broadcast", {
|
||||||
|
namespace: "/",
|
||||||
|
event: "LS_UNCOMPRESSION_JOB_COMPLETE",
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
uncompressedArchive: job.returnvalue,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
return job.returnvalue;
|
||||||
},
|
},
|
||||||
// use the `${QUEUE_NAME}.QUEUE_EVENT` scheme
|
// use the `${QUEUE_NAME}.QUEUE_EVENT` scheme
|
||||||
async "enqueue.async.active"(ctx: Context<{ id: Number }>) {
|
async "enqueue.async.active"(ctx: Context<{ id: Number }>) {
|
||||||
|
|||||||
@@ -80,14 +80,19 @@ export default class ImportService extends Service {
|
|||||||
},
|
},
|
||||||
walkFolders: {
|
walkFolders: {
|
||||||
rest: "POST /walkFolders",
|
rest: "POST /walkFolders",
|
||||||
params: {
|
params: {},
|
||||||
basePathToWalk: "string",
|
async handler(
|
||||||
},
|
ctx: Context<{
|
||||||
async handler(ctx: Context<{ basePathToWalk: string }>) {
|
basePathToWalk: string;
|
||||||
|
extensions: string[];
|
||||||
|
}>
|
||||||
|
) {
|
||||||
|
console.log(ctx.params);
|
||||||
return await walkFolder(ctx.params.basePathToWalk, [
|
return await walkFolder(ctx.params.basePathToWalk, [
|
||||||
".cbz",
|
".cbz",
|
||||||
".cbr",
|
".cbr",
|
||||||
".cb7",
|
".cb7",
|
||||||
|
...ctx.params.extensions,
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user