only disconnect redis message queue client if it is different from cache client

This commit is contained in:
Hongbo Wu
2024-07-04 16:09:32 +08:00
parent 0a1b7345e9
commit 649463b785
4 changed files with 86 additions and 60 deletions

View File

@ -28,9 +28,12 @@ export class RedisDataSource {
async shutdown(): Promise<void> {
try {
await this.queueRedisClient?.quit()
await this.cacheClient?.quit()
if (this.queueRedisClient !== this.cacheClient) {
await this.queueRedisClient.quit()
}
console.log('redis shutdown complete')
} catch (err) {
console.error('error while shutting down redis', err)