🤐 Added uncompression event
This commit is contained in:
@@ -352,6 +352,17 @@ export default class JobQueueService extends Service {
|
||||
console.log(
|
||||
`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
|
||||
async "enqueue.async.active"(ctx: Context<{ id: Number }>) {
|
||||
|
||||
@@ -80,14 +80,19 @@ export default class ImportService extends Service {
|
||||
},
|
||||
walkFolders: {
|
||||
rest: "POST /walkFolders",
|
||||
params: {
|
||||
basePathToWalk: "string",
|
||||
},
|
||||
async handler(ctx: Context<{ basePathToWalk: string }>) {
|
||||
params: {},
|
||||
async handler(
|
||||
ctx: Context<{
|
||||
basePathToWalk: string;
|
||||
extensions: string[];
|
||||
}>
|
||||
) {
|
||||
console.log(ctx.params);
|
||||
return await walkFolder(ctx.params.basePathToWalk, [
|
||||
".cbz",
|
||||
".cbr",
|
||||
".cb7",
|
||||
...ctx.params.extensions,
|
||||
]);
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user