mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-13 07:04:50 -06:00
feat: Restart WebSocket connection on Wavoip token update
- Added logic to restart the WebSocket connection in `ChannelStartupService` when a valid `wavoipToken` is set, ensuring the client reconnects with updated settings.
This commit is contained in:
parent
5043ce8405
commit
5d91876974
@ -200,6 +200,12 @@ export class ChannelStartupService {
|
||||
this.logger.verbose(`Settings wavoipToken: ${data.wavoipToken}`);
|
||||
Object.assign(this.localSettings, data);
|
||||
this.logger.verbose('Settings set');
|
||||
|
||||
// restart instance
|
||||
if (this.localSettings.wavoipToken && this.localSettings.wavoipToken.length > 0) {
|
||||
this.client.ws.close();
|
||||
this.client.ws.connect();
|
||||
}
|
||||
}
|
||||
|
||||
public async findSettings() {
|
||||
|
Loading…
Reference in New Issue
Block a user