✏️ Renamed queue service and refactored
This commit is contained in:
12
package-lock.json
generated
12
package-lock.json
generated
@@ -8862,9 +8862,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimist": {
|
"node_modules/minimist": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||||
},
|
},
|
||||||
"node_modules/mkdirp": {
|
"node_modules/mkdirp": {
|
||||||
"version": "0.5.5",
|
"version": "0.5.5",
|
||||||
@@ -21876,9 +21876,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||||
},
|
},
|
||||||
"mkdirp": {
|
"mkdirp": {
|
||||||
"version": "0.5.5",
|
"version": "0.5.5",
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default class ApiService extends Service {
|
|||||||
break;
|
break;
|
||||||
case "LS_TOGGLE_IMPORT_QUEUE":
|
case "LS_TOGGLE_IMPORT_QUEUE":
|
||||||
console.log("lol")
|
console.log("lol")
|
||||||
await this.broker.call("queue.toggleImportQueue", action.data, {});
|
await this.broker.call("importqueue.toggleImportQueue", action.data, {});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -148,7 +148,7 @@ export default class ApiService extends Service {
|
|||||||
await broker.call("library.walkFolders", {
|
await broker.call("library.walkFolders", {
|
||||||
basePathToWalk: path,
|
basePathToWalk: path,
|
||||||
});
|
});
|
||||||
await this.broker.call("queue.processImport", {
|
await this.broker.call("importqueue.processImport", {
|
||||||
fileObject: {
|
fileObject: {
|
||||||
filePath: walkedFolder[0].filePath,
|
filePath: walkedFolder[0].filePath,
|
||||||
fileSize: walkedFolder[0].fileSize,
|
fileSize: walkedFolder[0].fileSize,
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ export default class ImportService extends Service {
|
|||||||
});
|
});
|
||||||
if (!comicExists) {
|
if (!comicExists) {
|
||||||
// 2. Send the extraction job to the queue
|
// 2. Send the extraction job to the queue
|
||||||
await broker.call("queue.processImport", {
|
await broker.call("importqueue.processImport", {
|
||||||
fileObject: {
|
fileObject: {
|
||||||
filePath: item.path,
|
filePath: item.path,
|
||||||
fileSize: item.stats.size,
|
fileSize: item.stats.size,
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ SOFTWARE.
|
|||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { extend, isNil, isUndefined } from "lodash";
|
|
||||||
import {
|
import {
|
||||||
Context,
|
Context,
|
||||||
Service,
|
Service,
|
||||||
@@ -55,10 +54,13 @@ const REDIS_URI = process.env.REDIS_URI || `redis://localhost:6379`;
|
|||||||
|
|
||||||
console.log(`REDIS -> ${REDIS_URI}`);
|
console.log(`REDIS -> ${REDIS_URI}`);
|
||||||
export default class QueueService extends Service {
|
export default class QueueService extends Service {
|
||||||
public constructor(public broker: ServiceBroker) {
|
public constructor(
|
||||||
|
public broker: ServiceBroker,
|
||||||
|
schema: ServiceSchema<{}> = { name: "importqueue" }
|
||||||
|
) {
|
||||||
super(broker);
|
super(broker);
|
||||||
this.parseServiceSchema({
|
this.parseServiceSchema({
|
||||||
name: "queue",
|
name: "importqueue",
|
||||||
mixins: [BullMQMixin(REDIS_URI), DbMixin("comics", Comic)],
|
mixins: [BullMQMixin(REDIS_URI), DbMixin("comics", Comic)],
|
||||||
settings: {},
|
settings: {},
|
||||||
hooks: {},
|
hooks: {},
|
||||||
|
|||||||
@@ -4838,9 +4838,9 @@
|
|||||||
"brace-expansion" "^1.1.7"
|
"brace-expansion" "^1.1.7"
|
||||||
|
|
||||||
"minimist@^1.2.0", "minimist@^1.2.3", "minimist@^1.2.5":
|
"minimist@^1.2.0", "minimist@^1.2.3", "minimist@^1.2.5":
|
||||||
"integrity" "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
"integrity" "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||||
"resolved" "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz"
|
"resolved" "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz"
|
||||||
"version" "1.2.5"
|
"version" "1.2.6"
|
||||||
|
|
||||||
"minipass-collect@^1.0.2":
|
"minipass-collect@^1.0.2":
|
||||||
"version" "1.0.2"
|
"version" "1.0.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user