mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-09 21:32:20 -06:00
Merge pull request #2191 from JefersonRamos/bugfix/waiting-for-message
Durante o processo de logout de uma instância, as chaves associadas a…
This commit is contained in:
@@ -266,6 +266,28 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
|
||||
this.client?.ws?.close();
|
||||
|
||||
const db = this.configService.get<Database>('DATABASE');
|
||||
const cache = this.configService.get<CacheConf>('CACHE');
|
||||
const provider = this.configService.get<ProviderSession>('PROVIDER');
|
||||
|
||||
if (provider?.ENABLED) {
|
||||
const authState = await this.authStateProvider.authStateProvider(this.instance.id);
|
||||
|
||||
await authState.removeCreds();
|
||||
}
|
||||
|
||||
if (cache?.REDIS.ENABLED && cache?.REDIS.SAVE_INSTANCES) {
|
||||
const authState = await useMultiFileAuthStateRedisDb(this.instance.id, this.cache);
|
||||
|
||||
await authState.removeCreds();
|
||||
}
|
||||
|
||||
if (db.SAVE_DATA.INSTANCE) {
|
||||
const authState = await useMultiFileAuthStatePrisma(this.instance.id, this.cache);
|
||||
|
||||
await authState.removeCreds();
|
||||
}
|
||||
|
||||
const sessionExists = await this.prismaRepository.session.findFirst({ where: { sessionId: this.instanceId } });
|
||||
if (sessionExists) {
|
||||
await this.prismaRepository.session.delete({ where: { sessionId: this.instanceId } });
|
||||
|
||||
Reference in New Issue
Block a user