vona-module-a-queue 5.0.27 → 5.0.29
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 +5 -4
- package/dist/types/queue.d.ts +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { BeanInfo, BeanBase,
|
|
1
|
+
import { BeanInfo, BeanBase, 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';
|
|
5
|
+
import { getRedisClientKeyPrefix } from 'vona-module-a-redis';
|
|
5
6
|
import { Startup } from 'vona-module-a-startup';
|
|
6
7
|
|
|
7
8
|
var _dec$2, _dec2$2, _class$2;
|
|
@@ -65,12 +66,11 @@ let ServiceQueue = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
|
65
66
|
// queueConfig.options: queue/worker/job/redlock
|
|
66
67
|
const workerOptions = queueConfig?.options?.worker;
|
|
67
68
|
const redlockOptions = queueConfig?.options?.redlock;
|
|
68
|
-
const
|
|
69
|
-
const _lockTTL = redlockOptions?.lockTTL ?? this.$scope.redlock.config.redlock.lockTTL;
|
|
69
|
+
const _lockTTL = redlockOptions?.lockTTL ?? this.$scope.redlock.config.lockTTL;
|
|
70
70
|
|
|
71
71
|
// redlock
|
|
72
72
|
if (!queueConfig?.concurrency) {
|
|
73
|
-
_worker.redlock = this.$scope.redlock.service.redlock.create(
|
|
73
|
+
_worker.redlock = this.$scope.redlock.service.redlock.create(redlockOptions);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// create work
|
|
@@ -265,6 +265,7 @@ let ServiceQueue = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
|
265
265
|
}, {
|
|
266
266
|
dbInfo: info.options?.dbInfo,
|
|
267
267
|
locale: info.options?.locale,
|
|
268
|
+
tz: info.options?.tz,
|
|
268
269
|
instanceName: info.options?.instanceName,
|
|
269
270
|
extraData: info.options?.extraData,
|
|
270
271
|
transaction: queueConfig?.transaction
|
package/dist/types/queue.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type Redlock from '@sesamecare-oss/redlock';
|
|
2
2
|
import type * as Bull from 'bullmq';
|
|
3
|
-
import type { OmitNever } from 'vona';
|
|
3
|
+
import type { OmitNever, PowerPartial } from 'vona';
|
|
4
4
|
import type { IGeneralInfoOptions } from 'vona-module-a-executor';
|
|
5
5
|
import type { ServiceOnion, TypeOnionOptionsEnableSimple } from 'vona-module-a-onion';
|
|
6
|
+
import type { IRedlockClientOptions } from 'vona-module-a-redlock';
|
|
6
7
|
export interface IQueuePushOptions extends IGeneralInfoOptions {
|
|
7
8
|
queueNameSub?: string;
|
|
8
9
|
jobName?: string;
|
|
@@ -51,7 +52,7 @@ export interface IDecoratorQueueOptions extends TypeOnionOptionsEnableSimple {
|
|
|
51
52
|
options?: {
|
|
52
53
|
queue?: Partial<Bull.QueueOptions>;
|
|
53
54
|
worker?: Partial<Bull.WorkerOptions>;
|
|
54
|
-
redlock?:
|
|
55
|
+
redlock?: PowerPartial<IRedlockClientOptions> & {
|
|
55
56
|
lockTTL?: number;
|
|
56
57
|
};
|
|
57
58
|
job?: Bull.JobsOptions;
|