@midwayjs/bull 3.8.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/decorator.d.ts +1 -1
- package/dist/framework.d.ts +1 -1
- package/dist/framework.js +6 -4
- package/package.json +4 -4
package/dist/decorator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JobOptions } from 'bull';
|
|
2
|
-
export declare function Processor(queueName: string,
|
|
2
|
+
export declare function Processor(queueName: string, jobOptions?: JobOptions): ClassDecorator;
|
|
3
3
|
export declare function Processor(queueName: string, concurrency?: number, jobOptions?: JobOptions): ClassDecorator;
|
|
4
4
|
export declare function InjectQueue(queueName: string): PropertyDecorator;
|
|
5
5
|
//# sourceMappingURL=decorator.d.ts.map
|
package/dist/framework.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class BullFramework extends BaseFramework<Application, Context, a
|
|
|
19
19
|
protected beforeStop(): Promise<void>;
|
|
20
20
|
createQueue(name: string, queueOptions?: QueueOptions): BullQueue;
|
|
21
21
|
getQueue(name: string): BullQueue;
|
|
22
|
-
ensureQueue(name: string): BullQueue;
|
|
22
|
+
ensureQueue(name: string, queueOptions?: QueueOptions): BullQueue;
|
|
23
23
|
getQueueList(): BullQueue[];
|
|
24
24
|
addProcessor(processor: new (...args: any[]) => IProcessor, queueName: string | BullQueue, concurrency?: number): Promise<void>;
|
|
25
25
|
runJob(queueName: string, jobData: any, options?: JobOptions): Promise<Job | undefined>;
|
package/dist/framework.js
CHANGED
|
@@ -44,7 +44,9 @@ let BullFramework = class BullFramework extends core_1.BaseFramework {
|
|
|
44
44
|
const processorModules = (0, core_1.listModule)(constants_1.BULL_PROCESSOR_KEY);
|
|
45
45
|
for (const mod of processorModules) {
|
|
46
46
|
const options = (0, core_1.getClassMetadata)(constants_1.BULL_PROCESSOR_KEY, mod);
|
|
47
|
-
const currentQueue = this.ensureQueue(options.queueName
|
|
47
|
+
const currentQueue = this.ensureQueue(options.queueName, {
|
|
48
|
+
defaultJobOptions: options.jobOptions,
|
|
49
|
+
});
|
|
48
50
|
// clear old repeat job when start
|
|
49
51
|
if (this.bullClearRepeatJobWhenStart) {
|
|
50
52
|
const jobs = await currentQueue.getRepeatableJobs();
|
|
@@ -65,16 +67,16 @@ let BullFramework = class BullFramework extends core_1.BaseFramework {
|
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
createQueue(name, queueOptions = {}) {
|
|
68
|
-
const queue = new BullQueue(name, (0, core_1.extend)(true, this.bullDefaultQueueConfig, queueOptions));
|
|
70
|
+
const queue = new BullQueue(name, (0, core_1.extend)(true, {}, this.bullDefaultQueueConfig, queueOptions));
|
|
69
71
|
this.queueMap.set(name, queue);
|
|
70
72
|
return queue;
|
|
71
73
|
}
|
|
72
74
|
getQueue(name) {
|
|
73
75
|
return this.queueMap.get(name);
|
|
74
76
|
}
|
|
75
|
-
ensureQueue(name) {
|
|
77
|
+
ensureQueue(name, queueOptions = {}) {
|
|
76
78
|
if (!this.queueMap.has(name)) {
|
|
77
|
-
this.createQueue(name);
|
|
79
|
+
this.createQueue(name, queueOptions);
|
|
78
80
|
}
|
|
79
81
|
return this.queueMap.get(name);
|
|
80
82
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/bull",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "midway component for bull",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
],
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@midwayjs/core": "^3.
|
|
28
|
-
"@midwayjs/mock": "^3.
|
|
27
|
+
"@midwayjs/core": "^3.9.0",
|
|
28
|
+
"@midwayjs/mock": "^3.9.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"bull": "4.10.1"
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=12"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "5f6603d2c9606fc6fc7ece71f956e89e394efeee"
|
|
37
37
|
}
|