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:
Davidson Gomes 2025-05-29 19:43:54 -03:00
parent 5043ce8405
commit 5d91876974

View File

@ -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() {