mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-19 17:59:12 -06:00
fix: logout wa business instance
This commit is contained in:
parent
bc6944736e
commit
a931ee7afb
@ -664,11 +664,7 @@ export class InstanceController {
|
||||
}
|
||||
|
||||
try {
|
||||
this.logger.verbose('logging out instance: ' + instanceName);
|
||||
await this.waMonitor.waInstances[instanceName]?.client?.logout('Log out instance: ' + instanceName);
|
||||
|
||||
this.logger.verbose('close connection instance: ' + instanceName);
|
||||
this.waMonitor.waInstances[instanceName]?.client?.ws?.close();
|
||||
this.waMonitor.waInstances[instanceName]?.logoutInstance();
|
||||
|
||||
return { status: 'SUCCESS', error: false, response: { message: 'Instance logged out' } };
|
||||
} catch (error) {
|
||||
|
@ -147,6 +147,14 @@ export class BaileysStartupService extends WAStartupService {
|
||||
return this.stateConnection;
|
||||
}
|
||||
|
||||
public async logoutInstance() {
|
||||
this.logger.verbose('logging out instance: ' + this.instanceName);
|
||||
await this.client?.logout('Log out instance: ' + this.instanceName);
|
||||
|
||||
this.logger.verbose('close connection instance: ' + this.instanceName);
|
||||
this.client?.ws?.close();
|
||||
}
|
||||
|
||||
public async getProfileName() {
|
||||
this.logger.verbose('Getting profile name');
|
||||
|
||||
|
@ -64,6 +64,11 @@ export class BusinessStartupService extends WAStartupService {
|
||||
};
|
||||
}
|
||||
|
||||
public async logoutInstance() {
|
||||
this.logger.verbose('Logging out instance');
|
||||
await this.closeClient();
|
||||
}
|
||||
|
||||
private async post(message: any, params: string) {
|
||||
try {
|
||||
const integration = await this.findIntegration();
|
||||
|
Loading…
Reference in New Issue
Block a user