vona-module-a-queue 5.0.25 → 5.0.27
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/index.js +6 -3
- package/dist/service/queue.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BeanInfo, BeanBase, uuidv4, deepExtend, instanceDesp, beanFullNameFromOnionName, BeanSimple, BeanScopeBase, createBeanDecorator } from 'vona';
|
|
1
|
+
import { BeanInfo, BeanBase, getRedisClientKeyPrefix, uuidv4, deepExtend, instanceDesp, beanFullNameFromOnionName, BeanSimple, BeanScopeBase, createBeanDecorator } from 'vona';
|
|
2
2
|
import { sleep } from '@cabloy/utils';
|
|
3
3
|
import * as Bull from 'bullmq';
|
|
4
4
|
import { Service, Scope } from 'vona-module-a-bean';
|
|
@@ -51,12 +51,15 @@ let ServiceQueue = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
|
51
51
|
}
|
|
52
52
|
this._queues = {};
|
|
53
53
|
}
|
|
54
|
+
_getPrefix() {
|
|
55
|
+
return `${getRedisClientKeyPrefix('bull', this.app)}queue`;
|
|
56
|
+
}
|
|
54
57
|
_createWorker(info, queueKey) {
|
|
55
58
|
const app = this.app;
|
|
56
59
|
// worker
|
|
57
60
|
const _worker = {};
|
|
58
61
|
// prefix
|
|
59
|
-
const prefix =
|
|
62
|
+
const prefix = this._getPrefix();
|
|
60
63
|
// queue config
|
|
61
64
|
const queueConfig = app.bean.onion.queue.getOnionOptions(info.queueName);
|
|
62
65
|
// queueConfig.options: queue/worker/job/redlock
|
|
@@ -116,7 +119,7 @@ let ServiceQueue = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
|
116
119
|
// queue
|
|
117
120
|
const _queue = {};
|
|
118
121
|
// prefix
|
|
119
|
-
const prefix =
|
|
122
|
+
const prefix = this._getPrefix();
|
|
120
123
|
// queue config
|
|
121
124
|
const queueConfig = app.bean.onion.queue.getOnionOptions(info.queueName);
|
|
122
125
|
// queueConfig.options: queue/worker/job/limiter
|
package/dist/service/queue.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class ServiceQueue extends BeanBase {
|
|
|
11
11
|
loadQueueWorkers(instanceName?: keyof IInstanceRecord | undefined | null): void;
|
|
12
12
|
clearWorkers(): Promise<void>;
|
|
13
13
|
clearQueues(): Promise<void>;
|
|
14
|
+
_getPrefix(): string;
|
|
14
15
|
_createWorker<DATA>(info: IQueueJobContext<DATA>, queueKey: string): IQueueWork;
|
|
15
16
|
_createQueue<DATA>(info: IQueueJobContext<DATA>, queueKey: string): IQueueQueue;
|
|
16
17
|
_ensureWorker<DATA>(info: IQueueJobContext<DATA>): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-queue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.27",
|
|
5
5
|
"title": "a-queue",
|
|
6
6
|
"vonaModule": {
|
|
7
7
|
"dependencies": {},
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"./package.json": "./package.json"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
|
+
"assets",
|
|
39
40
|
"cli",
|
|
40
|
-
"dist"
|
|
41
|
-
"static"
|
|
41
|
+
"dist"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"bullmq": "^5.58.0"
|