Handle renewal restart failures

This commit is contained in:
2026-06-22 12:09:21 +02:00
parent 24bbfc354f
commit a811feaede
2 changed files with 30 additions and 1 deletions
+9 -1
View File
@@ -227,7 +227,15 @@ export default class AudioManager {
}
this.renewTimer = setTimeout(() => {
void this.start();
void this.start().catch(() => {
this.clearRenewTimer();
this.stopCurrentPlayback();
this.audioPlayer.stop(true);
this.connection?.disconnect();
this.connection?.destroy();
this.connection = undefined;
this.playbackState = 'stopped';
});
}, renewIntervalMs);
if (typeof this.renewTimer.unref === 'function') {