mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix: harden local targets and monitor network continuously
This commit is contained in:
1 parent
12f440ab8b
commit
2b43952c01
5 files changed
+74
-39
No files matched your search
@@ -57,6 +57,8 @@ export class EndpointProtocolCache {
|
||||
|
||||
export const endpointProtocolCache = new EndpointProtocolCache();
|
||||
|
||||
const TEAM_SPEAK_CONNECT_TIMEOUT_MS = 15_000;
|
||||
|
||||
export interface TeamSpeakAdapterOptions {
|
||||
target: TeamSpeakTarget;
|
||||
nickname: string;
|
||||
@@ -109,8 +111,9 @@ export class TeamSpeakAdapter {
|
||||
this.logger.info({ target: formatTeamSpeakTarget(this.target), cachedProtocol }, "Connecting through TeamSpeak adapter");
|
||||
try {
|
||||
await this.client.connect();
|
||||
await this.client.waitConnected();
|
||||
await this.client.waitConnected(AbortSignal.timeout(TEAM_SPEAK_CONNECT_TIMEOUT_MS));
|
||||
} catch (error: unknown) {
|
||||
await this.client.disconnect().catch(() => undefined);
|
||||
throw normalizeTeamSpeakError(error);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user