From 0cd0bd5694af0d627e6a4f6d03564360055a8fb4 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 1 Mar 2026 21:55:51 -0800 Subject: [PATCH] =?UTF-8?q?fix(transfer):=20Outbox=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=80=BC=20Number()=20=E8=BD=AC=E5=9E=8B=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20Prisma=20take=20=E5=8F=82=E6=95=B0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 环境变量读取的值始终是 string,ConfigService.get 不会自动转型, 导致 Prisma findMany({ take: "100" }) 报 String 类型错误。 Co-Authored-By: Claude Opus 4.6 --- .../infrastructure/kafka/outbox-publisher.service.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/services/transfer-service/src/infrastructure/kafka/outbox-publisher.service.ts b/backend/services/transfer-service/src/infrastructure/kafka/outbox-publisher.service.ts index 02f4f828..7d1a1db2 100644 --- a/backend/services/transfer-service/src/infrastructure/kafka/outbox-publisher.service.ts +++ b/backend/services/transfer-service/src/infrastructure/kafka/outbox-publisher.service.ts @@ -27,11 +27,11 @@ export class OutboxPublisherService implements OnModuleInit, OnModuleDestroy { private readonly outboxRepository: OutboxRepository, private readonly configService: ConfigService, ) { - this.pollIntervalMs = this.configService.get('OUTBOX_POLL_INTERVAL_MS', 1000); - this.batchSize = this.configService.get('OUTBOX_BATCH_SIZE', 100); - this.cleanupIntervalMs = this.configService.get('OUTBOX_CLEANUP_INTERVAL_MS', 3600000); - this.confirmationTimeoutMinutes = this.configService.get('OUTBOX_CONFIRMATION_TIMEOUT_MINUTES', 5); - this.timeoutCheckIntervalMs = this.configService.get('OUTBOX_TIMEOUT_CHECK_INTERVAL_MS', 60000); + this.pollIntervalMs = Number(this.configService.get('OUTBOX_POLL_INTERVAL_MS', 1000)); + this.batchSize = Number(this.configService.get('OUTBOX_BATCH_SIZE', 100)); + this.cleanupIntervalMs = Number(this.configService.get('OUTBOX_CLEANUP_INTERVAL_MS', 3600000)); + this.confirmationTimeoutMinutes = Number(this.configService.get('OUTBOX_CONFIRMATION_TIMEOUT_MINUTES', 5)); + this.timeoutCheckIntervalMs = Number(this.configService.get('OUTBOX_TIMEOUT_CHECK_INTERVAL_MS', 60000)); } async onModuleInit() {