fix(transfer): Outbox 配置值 Number() 转型,修复 Prisma take 参数类型错误

环境变量读取的值始终是 string,ConfigService.get<number> 不会自动转型,
导致 Prisma findMany({ take: "100" }) 报 String 类型错误。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-01 21:55:51 -08:00
parent 5110915aa8
commit 0cd0bd5694
1 changed files with 5 additions and 5 deletions

View File

@ -27,11 +27,11 @@ export class OutboxPublisherService implements OnModuleInit, OnModuleDestroy {
private readonly outboxRepository: OutboxRepository, private readonly outboxRepository: OutboxRepository,
private readonly configService: ConfigService, private readonly configService: ConfigService,
) { ) {
this.pollIntervalMs = this.configService.get<number>('OUTBOX_POLL_INTERVAL_MS', 1000); this.pollIntervalMs = Number(this.configService.get('OUTBOX_POLL_INTERVAL_MS', 1000));
this.batchSize = this.configService.get<number>('OUTBOX_BATCH_SIZE', 100); this.batchSize = Number(this.configService.get('OUTBOX_BATCH_SIZE', 100));
this.cleanupIntervalMs = this.configService.get<number>('OUTBOX_CLEANUP_INTERVAL_MS', 3600000); this.cleanupIntervalMs = Number(this.configService.get('OUTBOX_CLEANUP_INTERVAL_MS', 3600000));
this.confirmationTimeoutMinutes = this.configService.get<number>('OUTBOX_CONFIRMATION_TIMEOUT_MINUTES', 5); this.confirmationTimeoutMinutes = Number(this.configService.get('OUTBOX_CONFIRMATION_TIMEOUT_MINUTES', 5));
this.timeoutCheckIntervalMs = this.configService.get<number>('OUTBOX_TIMEOUT_CHECK_INTERVAL_MS', 60000); this.timeoutCheckIntervalMs = Number(this.configService.get('OUTBOX_TIMEOUT_CHECK_INTERVAL_MS', 60000));
} }
async onModuleInit() { async onModuleInit() {