Added destructor in redis connection

This commit is contained in:
Davidson Gomes 2023-07-02 20:17:13 -03:00
parent d7d0e5ec82
commit 77f98c2438

View File

@ -79,4 +79,20 @@ export class RedisCache {
this.logger.error(error);
}
}
public async closeConnection() {
try {
await this.client.quit();
} catch (error) {
this.logger.error(error);
}
}
public async destructor() {
await this.closeConnection();
}
public async destroy() {
await this.destructor();
}
}