mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-25 18:08:40 -06:00
Remove unused import and bad additional websocket event
This commit is contained in:
parent
fbff945d5b
commit
cb36f04534
@ -2,7 +2,7 @@ import { WebsocketDto } from '@api/integrations/websocket/dto/websocket.dto';
|
|||||||
import { PrismaRepository } from '@api/repository/repository.service';
|
import { PrismaRepository } from '@api/repository/repository.service';
|
||||||
import { WAMonitoringService } from '@api/services/monitor.service';
|
import { WAMonitoringService } from '@api/services/monitor.service';
|
||||||
import { wa } from '@api/types/wa.types';
|
import { wa } from '@api/types/wa.types';
|
||||||
import { Auth, configService, Cors, HttpServer, Log, Websocket } from '@config/env.config';
|
import { configService, Cors, HttpServer, Log, Websocket } from '@config/env.config';
|
||||||
import { Logger } from '@config/logger.config';
|
import { Logger } from '@config/logger.config';
|
||||||
import { NotFoundException } from '@exceptions';
|
import { NotFoundException } from '@exceptions';
|
||||||
import { Server } from 'http';
|
import { Server } from 'http';
|
||||||
@ -14,7 +14,7 @@ export class WebsocketController {
|
|||||||
private waMonitor: WAMonitoringService;
|
private waMonitor: WAMonitoringService;
|
||||||
private corsConfig: Array<any>;
|
private corsConfig: Array<any>;
|
||||||
private readonly logger = new Logger('SocketStartupService');
|
private readonly logger = new Logger('SocketStartupService');
|
||||||
public readonly monitorEvents = ['REMOVE_INSTANCE', 'LOGOUT_INSTANCE', 'NO_CONNECTION'];
|
public readonly monitorEvents = ['REMOVE_INSTANCE', 'LOGOUT_INSTANCE'];
|
||||||
public readonly events = [
|
public readonly events = [
|
||||||
'APPLICATION_STARTUP',
|
'APPLICATION_STARTUP',
|
||||||
'QRCODE_UPDATED',
|
'QRCODE_UPDATED',
|
||||||
|
@ -382,13 +382,6 @@ export class WAMonitoringService {
|
|||||||
private noConnection() {
|
private noConnection() {
|
||||||
this.eventEmitter.on('no.connection', async (instanceName) => {
|
this.eventEmitter.on('no.connection', async (instanceName) => {
|
||||||
try {
|
try {
|
||||||
await websocketController.emit({
|
|
||||||
instanceName,
|
|
||||||
origin: WAMonitoringService.name,
|
|
||||||
event: 'no.connection',
|
|
||||||
data: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
await this.waInstances[instanceName]?.client?.logout('Log out instance: ' + instanceName);
|
await this.waInstances[instanceName]?.client?.logout('Log out instance: ' + instanceName);
|
||||||
|
|
||||||
this.waInstances[instanceName]?.client?.ws?.close();
|
this.waInstances[instanceName]?.client?.ws?.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user