fix: add missing redis client connect call in onModuleInit
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 58s

ioredis with lazyConnect: true requires explicit .connect() — without it
the client never connects and isHealthy() always returns false.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
WangDL 2026-05-17 23:00:11 +08:00
parent 3137d58a5d
commit bced62c8f6

View File

@ -32,6 +32,12 @@ export class RedisService implements OnModuleInit, OnModuleDestroy {
this._connected = false;
this.logger.warn(`Redis error: ${err.message}`);
});
try {
await this.client.connect();
} catch (err: any) {
this.logger.warn(`Redis connect failed: ${err.message}`);
}
}
async onModuleDestroy() {