@hastehaul/common 1.0.9 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.AbstractJobQueue = void 0;
|
4
4
|
const bullmq_1 = require("bullmq");
|
5
|
-
const
|
5
|
+
const connections_wrappers_1 = require("../../../connections-wrappers");
|
6
6
|
// Define the abstract class
|
7
7
|
class AbstractJobQueue {
|
8
8
|
constructor(queueName) {
|
9
|
-
this.que = new bullmq_1.Queue(queueName, { connection:
|
9
|
+
this.que = new bullmq_1.Queue(queueName, { connection: connections_wrappers_1.redisWrapper.client });
|
10
10
|
}
|
11
11
|
}
|
12
12
|
exports.AbstractJobQueue = AbstractJobQueue;
|
@@ -1,9 +1,6 @@
|
|
1
1
|
import { Job, Worker } from "bullmq";
|
2
|
-
export type JobT = {
|
3
|
-
job: Job;
|
4
|
-
};
|
5
2
|
export declare abstract class AbstractWorker {
|
6
3
|
protected worker: Worker;
|
7
4
|
constructor(queueName: string);
|
8
|
-
protected abstract process(job:
|
5
|
+
protected abstract process(job: Job): Promise<void>;
|
9
6
|
}
|
@@ -2,11 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.AbstractWorker = void 0;
|
4
4
|
const bullmq_1 = require("bullmq");
|
5
|
-
const
|
5
|
+
const connections_wrappers_1 = require("../../../connections-wrappers");
|
6
6
|
class AbstractWorker {
|
7
7
|
constructor(queueName) {
|
8
8
|
this.worker = new bullmq_1.Worker(queueName, this.process.bind(this), {
|
9
|
-
connection:
|
9
|
+
connection: connections_wrappers_1.redisWrapper.client,
|
10
10
|
autorun: false,
|
11
11
|
});
|
12
12
|
this.worker.on("error", (err) => {
|