mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 20:12:02 -06:00
Remove instance from redis even if using database
This commit is contained in:
parent
dbb6ea9147
commit
041b3c5e1f
@ -120,6 +120,7 @@ export class WAMonitoringService {
|
||||
}
|
||||
|
||||
public async cleaningUp(instanceName: string) {
|
||||
let instanceDbId: string;
|
||||
if (this.db.ENABLED && this.db.SAVE_DATA.INSTANCE) {
|
||||
const instance = await this.prismaRepository.instance.update({
|
||||
where: { name: instanceName },
|
||||
@ -130,13 +131,16 @@ export class WAMonitoringService {
|
||||
|
||||
rmSync(join(INSTANCE_DIR, instance.id), { recursive: true, force: true });
|
||||
|
||||
instanceDbId = instance.id;
|
||||
await this.prismaRepository.session.deleteMany({ where: { sessionId: instance.id } });
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.redis.REDIS.ENABLED && this.redis.REDIS.SAVE_INSTANCES) {
|
||||
console.log({ instanceName, instanceDbId });
|
||||
await this.cache.delete(instanceName);
|
||||
return;
|
||||
if (instanceDbId) {
|
||||
await this.cache.delete(instanceDbId);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.providerSession?.ENABLED) {
|
||||
|
Loading…
Reference in New Issue
Block a user