Skip to content

Commit 4a0b384

Browse files
🐛(discovery-server): fix env type inference and class property error
1 parent 7963ae1 commit 4a0b384

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

services/discovery-server/src/config/env.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,14 @@ import {
44
} from "@trading-model/common/validation/env";
55
import { z } from "zod";
66

7-
const DISCOVERY_ENV_DEFS = [
8-
[
9-
"CLEANUP_SERVICE_INTERVAL_MS",
10-
z.coerce
11-
.number()
12-
.int()
13-
.positive()
14-
.default(1_000 * 60 * 10),
15-
],
16-
["ERROR_URL_WEBHOOK", z.union([z.string().url(), z.literal("")]).default("")],
17-
] as const satisfies readonly (readonly [string, z.ZodTypeAny])[];
18-
19-
const DISCOVERY_EXTRA = Object.fromEntries(DISCOVERY_ENV_DEFS) as Record<
20-
string,
21-
z.ZodTypeAny
22-
>;
7+
const DISCOVERY_EXTRA = {
8+
CLEANUP_SERVICE_INTERVAL_MS: z.coerce
9+
.number()
10+
.int()
11+
.positive()
12+
.default(1_000 * 60 * 10),
13+
ERROR_URL_WEBHOOK: z.union([z.string().url(), z.literal("")]).default(""),
14+
} satisfies Record<string, z.ZodTypeAny>;
2315

2416
const DISCOVERY_ENV_SCHEMA = BaseEnvSchema.extend(DISCOVERY_EXTRA);
2517

services/discovery-server/src/core/cached-registry-backend.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export class CachedRegistryBackend implements RegistryBackend {
3434
redisFailureThreshold = 3,
3535
redisHealthCheckIntervalMs = 15_000
3636
) {
37-
this.cacheTtlMs = cacheTtlMs;
3837
this._redisUrlForPubSub = redisUrlForPubSub;
3938
this._redisFailureThreshold = redisFailureThreshold;
4039
this._redisHealthCheckIntervalMs = redisHealthCheckIntervalMs;

0 commit comments

Comments
 (0)