⏯ Added pause/resume control method for bullmq
This commit is contained in:
@@ -104,9 +104,9 @@ export default class ApiService extends Service {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case "LS_PAUSE_IMPORT_QUEUE":
|
case "LS_TOGGLE_IMPORT_QUEUE":
|
||||||
console.log("lol")
|
console.log("lol")
|
||||||
await this.broker.call("queue.pauseImportQueue", action.data);
|
await this.broker.call("queue.toggleImportQueue", action.data, {});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -153,12 +153,28 @@ export default class QueueService extends Service {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
pauseImportQueue: {
|
toggleImportQueue: {
|
||||||
rest: "POST /pauseImportQueue",
|
rest: "POST /pauseImportQueue",
|
||||||
params: {},
|
params: {},
|
||||||
handler: async (ctx: Context<{}>) => {
|
handler: async (ctx: Context<{ action: string }>) => {
|
||||||
return await this.getQueue("process.import").resume();
|
console.log(ctx.params);
|
||||||
}
|
switch (ctx.params.action) {
|
||||||
|
case "pause":
|
||||||
|
const foo = await this.getQueue(
|
||||||
|
"process.import"
|
||||||
|
).pause();
|
||||||
|
console.log(foo);
|
||||||
|
break;
|
||||||
|
case "resume":
|
||||||
|
const soo = await this.getQueue(
|
||||||
|
"process.import"
|
||||||
|
).resume();
|
||||||
|
console.log(soo);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log("Unrecognized queue action.");
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
unarchiveComicBook: {
|
unarchiveComicBook: {
|
||||||
rest: "POST /unarchiveComicBook",
|
rest: "POST /unarchiveComicBook",
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ export const extractComicInfoXMLFromRar = async (
|
|||||||
// orchestrate result
|
// orchestrate result
|
||||||
console.log("ASDAsd");
|
console.log("ASDAsd");
|
||||||
resolve({
|
resolve({
|
||||||
|
filePath,
|
||||||
name: fileNameWithoutExtension,
|
name: fileNameWithoutExtension,
|
||||||
extension,
|
extension,
|
||||||
containedIn: targetDirectory,
|
containedIn: targetDirectory,
|
||||||
|
|||||||
Reference in New Issue
Block a user