@diia-inhouse/workflow 2.9.4 → 2.9.6
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClientOptions, ConnectionOptions } from "@temporalio/client";
|
|
2
|
-
import { MetricsConfig } from "@diia-inhouse/diia-metrics";
|
|
3
2
|
import { QueueConnectionConfig } from "@diia-inhouse/diia-queue";
|
|
3
|
+
import { MetricsConfig } from "@diia-inhouse/diia-metrics";
|
|
4
4
|
|
|
5
5
|
//#region src/interfaces/config.d.ts
|
|
6
6
|
interface TemporalConfig extends Omit<ClientOptions, "dataConverter"> {
|
|
@@ -20,7 +20,7 @@ declare function applyServiceProcessConfig(config: AppConfig): void;
|
|
|
20
20
|
/**
|
|
21
21
|
* Applies worker process configuration overrides.
|
|
22
22
|
*
|
|
23
|
-
* - Disables queue consumers on
|
|
23
|
+
* - Disables queue consumers on the internal and external rabbit connections (unless `temporal.disableQueueConsumers` is `false`)
|
|
24
24
|
* - Overrides `metrics.custom.port` with the `'temporal-worker'` scraper port and disables that scraper to prevent self-scraping
|
|
25
25
|
*
|
|
26
26
|
* Mutates the config object in place. Safe to call when queue config is absent.
|
package/dist/services/worker.js
CHANGED
|
@@ -12,6 +12,7 @@ import { fileURLToPath } from "node:url";
|
|
|
12
12
|
import { Resource } from "@opentelemetry/resources";
|
|
13
13
|
import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
|
|
14
14
|
import { OpenTelemetryActivityInboundInterceptor, OpenTelemetryActivityOutboundInterceptor, makeWorkflowExporter } from "@temporalio/interceptors-opentelemetry/lib/worker/index.js";
|
|
15
|
+
import { QueueConnectionType } from "@diia-inhouse/diia-queue";
|
|
15
16
|
//#region src/services/worker.ts
|
|
16
17
|
/**
|
|
17
18
|
* Applies service process configuration overrides when the worker runs separately.
|
|
@@ -29,15 +30,16 @@ function applyServiceProcessConfig(config) {
|
|
|
29
30
|
/**
|
|
30
31
|
* Applies worker process configuration overrides.
|
|
31
32
|
*
|
|
32
|
-
* - Disables queue consumers on
|
|
33
|
+
* - Disables queue consumers on the internal and external rabbit connections (unless `temporal.disableQueueConsumers` is `false`)
|
|
33
34
|
* - Overrides `metrics.custom.port` with the `'temporal-worker'` scraper port and disables that scraper to prevent self-scraping
|
|
34
35
|
*
|
|
35
36
|
* Mutates the config object in place. Safe to call when queue config is absent.
|
|
36
37
|
*/
|
|
37
38
|
function applyWorkerProcessConfig(config) {
|
|
38
39
|
const { disableQueueConsumers = true } = config.temporal;
|
|
39
|
-
if (disableQueueConsumers && config.rabbit) {
|
|
40
|
-
|
|
40
|
+
if (disableQueueConsumers && config.rabbit) for (const connectionType of [QueueConnectionType.Internal, QueueConnectionType.External]) {
|
|
41
|
+
const connectionConfig = config.rabbit[connectionType];
|
|
42
|
+
if (connectionConfig) connectionConfig.consumerEnabled = false;
|
|
41
43
|
}
|
|
42
44
|
const workerScraper = config.metrics.custom.scrapers?.find((s) => s.name === "temporal-worker");
|
|
43
45
|
if (workerScraper?.port !== void 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/workflow",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.6",
|
|
4
4
|
"description": "Workflow",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -100,15 +100,15 @@
|
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@diia-inhouse/configs": "7.0.1",
|
|
103
|
-
"@diia-inhouse/diia-logger": "4.
|
|
104
|
-
"@diia-inhouse/diia-metrics": "7.1.
|
|
105
|
-
"@diia-inhouse/diia-queue": "14.0.
|
|
106
|
-
"@diia-inhouse/env": "3.3.
|
|
107
|
-
"@diia-inhouse/healthcheck": "2.1.
|
|
103
|
+
"@diia-inhouse/diia-logger": "4.4.0",
|
|
104
|
+
"@diia-inhouse/diia-metrics": "7.1.38",
|
|
105
|
+
"@diia-inhouse/diia-queue": "14.0.28",
|
|
106
|
+
"@diia-inhouse/env": "3.3.23",
|
|
107
|
+
"@diia-inhouse/healthcheck": "2.1.43",
|
|
108
108
|
"@diia-inhouse/oxc-config": "1.11.0",
|
|
109
109
|
"@diia-inhouse/test": "8.2.14",
|
|
110
|
-
"@diia-inhouse/types": "14.
|
|
111
|
-
"@diia-inhouse/utils": "6.0.
|
|
110
|
+
"@diia-inhouse/types": "14.1.0",
|
|
111
|
+
"@diia-inhouse/utils": "6.0.37",
|
|
112
112
|
"@types/lodash": "4.17.24",
|
|
113
113
|
"@types/node": "25.6.2",
|
|
114
114
|
"@types/yargs": "17.0.35",
|