@anchan828/nest-cloud-run-queue-worker 3.1.9 → 3.1.11
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.
|
@@ -55,14 +55,18 @@ let QueueWorkerExplorerService = class QueueWorkerExplorerService {
|
|
|
55
55
|
const instance = worker.instance;
|
|
56
56
|
const prototype = Object.getPrototypeOf(instance);
|
|
57
57
|
for (const methodName of this.metadataScanner.getAllMethodNames(prototype)) {
|
|
58
|
-
const
|
|
58
|
+
const processor = Reflect.get(instance, methodName);
|
|
59
|
+
if (!processor) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const args = Reflect.getMetadata(constants_1.QUEUE_WORKER_PROCESS_DECORATOR, processor);
|
|
59
63
|
if (args) {
|
|
60
64
|
if (args.enabled === false) {
|
|
61
65
|
continue;
|
|
62
66
|
}
|
|
63
67
|
metadata.push({
|
|
64
68
|
priority: args.priority || 0,
|
|
65
|
-
processor
|
|
69
|
+
processor,
|
|
66
70
|
processorName: `${worker.className}.${methodName}`,
|
|
67
71
|
workerName: worker.name,
|
|
68
72
|
});
|
package/dist/cjs/interfaces.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Message, ModuleAsyncOptions, ModuleOptions, ModuleOptionsFactory, QueueWorkerName } from "@anchan828/nest-cloud-run-queue-common";
|
|
2
2
|
import { RequestMappingMetadata } from "@nestjs/common";
|
|
3
|
-
import { Injectable } from "@nestjs/common/interfaces";
|
|
4
3
|
export interface QueueWorkerModuleOptions extends ModuleOptions {
|
|
5
4
|
/**
|
|
6
5
|
* Whether to return 4xx codes when throw error about nest-cloud-run-queue-pubsub module. Default is false.
|
|
@@ -37,7 +36,7 @@ export type QueueWorkerModuleOptionsFactory = ModuleOptionsFactory<Omit<QueueWor
|
|
|
37
36
|
export type QueueWorkerProcessor = <T>(message: T, raw: QueueWorkerRawMessage) => Promise<void> | void;
|
|
38
37
|
export interface QueueWorkerMetadata {
|
|
39
38
|
className: string;
|
|
40
|
-
instance:
|
|
39
|
+
instance: any;
|
|
41
40
|
processors: QueueWorkerProcessorMetadata[];
|
|
42
41
|
name: QueueWorkerName;
|
|
43
42
|
priority: number;
|
|
@@ -52,14 +52,18 @@ let QueueWorkerExplorerService = class QueueWorkerExplorerService {
|
|
|
52
52
|
const instance = worker.instance;
|
|
53
53
|
const prototype = Object.getPrototypeOf(instance);
|
|
54
54
|
for (const methodName of this.metadataScanner.getAllMethodNames(prototype)) {
|
|
55
|
-
const
|
|
55
|
+
const processor = Reflect.get(instance, methodName);
|
|
56
|
+
if (!processor) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const args = Reflect.getMetadata(QUEUE_WORKER_PROCESS_DECORATOR, processor);
|
|
56
60
|
if (args) {
|
|
57
61
|
if (args.enabled === false) {
|
|
58
62
|
continue;
|
|
59
63
|
}
|
|
60
64
|
metadata.push({
|
|
61
65
|
priority: args.priority || 0,
|
|
62
|
-
processor
|
|
66
|
+
processor,
|
|
63
67
|
processorName: `${worker.className}.${methodName}`,
|
|
64
68
|
workerName: worker.name,
|
|
65
69
|
});
|
package/dist/esm/interfaces.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Message, ModuleAsyncOptions, ModuleOptions, ModuleOptionsFactory, QueueWorkerName } from "@anchan828/nest-cloud-run-queue-common";
|
|
2
2
|
import { RequestMappingMetadata } from "@nestjs/common";
|
|
3
|
-
import { Injectable } from "@nestjs/common/interfaces";
|
|
4
3
|
export interface QueueWorkerModuleOptions extends ModuleOptions {
|
|
5
4
|
/**
|
|
6
5
|
* Whether to return 4xx codes when throw error about nest-cloud-run-queue-pubsub module. Default is false.
|
|
@@ -37,7 +36,7 @@ export type QueueWorkerModuleOptionsFactory = ModuleOptionsFactory<Omit<QueueWor
|
|
|
37
36
|
export type QueueWorkerProcessor = <T>(message: T, raw: QueueWorkerRawMessage) => Promise<void> | void;
|
|
38
37
|
export interface QueueWorkerMetadata {
|
|
39
38
|
className: string;
|
|
40
|
-
instance:
|
|
39
|
+
instance: any;
|
|
41
40
|
processors: QueueWorkerProcessorMetadata[];
|
|
42
41
|
name: QueueWorkerName;
|
|
43
42
|
priority: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anchan828/nest-cloud-run-queue-worker",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.11",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "https://github.com/anchan828/nest-cloud-run-queue/tree/master/packages/worker#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"watch": "tsc -w"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@anchan828/nest-cloud-run-queue-common": "^3.1.
|
|
36
|
+
"@anchan828/nest-cloud-run-queue-common": "^3.1.11"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@nestjs/common": "10.4.1",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"default": "./dist/cjs/index.js"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "251d6ed89b2e55ced6615b3c104f33eb6e0254e4"
|
|
64
64
|
}
|