Added concurrency of 30 to import queue

This commit is contained in:
2021-12-04 09:34:33 -08:00
parent 2c16de674f
commit ecd5d155fc
3 changed files with 4 additions and 2 deletions

View File

@@ -99,15 +99,15 @@ export default class ApiService extends Service {
console.log("Client connected via websocket!"); console.log("Client connected via websocket!");
client.on("action", async (action) => { client.on("action", async (action) => {
console.log("ACCCCCTION", action);
switch (action.type) { switch (action.type) {
case "LS_IMPORT": case "LS_IMPORT":
// 1. Send task to queue // 1. Send task to queue
const result = await this.broker.call( await this.broker.call(
"import.newImport", "import.newImport",
action.data, action.data,
{} {}
); );
client.emit("LS_COVER_EXTRACTED", result);
break; break;
} }
}); });

View File

@@ -80,6 +80,7 @@ export default class ImportService extends Service {
}> }>
) { ) {
// 1. Walk the Source folder // 1. Walk the Source folder
klaw(path.resolve(COMICS_DIRECTORY)) klaw(path.resolve(COMICS_DIRECTORY))
// 1.1 Filter on .cb* extensions // 1.1 Filter on .cb* extensions
.pipe( .pipe(

View File

@@ -28,6 +28,7 @@ export default class LibraryQueueService extends Service {
hooks: {}, hooks: {},
queues: { queues: {
"process.import": { "process.import": {
concurrency: 30,
async process(job: SandboxedJob) { async process(job: SandboxedJob) {
console.info("New job received!", job.data); console.info("New job received!", job.data);
console.info(`Processing queue...`); console.info(`Processing queue...`);