fix: disconnection issue by adding a persistent ping (#121)
CD / Test (push) Successful in 19s
CD / Create tag (push) Successful in 18s
CD / Build and push (amd64) (push) Successful in 34s
CD / Build and push (arm64) (push) Successful in 1m38s
CD / Create manifest (push) Successful in 8s

Fixes the frequent disconnection issue, by adding a ping.
The "version" call works without authentication and is lightweight. Passing the "true" flag, prevents delivery of cached results.
This keeps the socket always connected. Feature may be removed in the future if the upstream library has a proper fix for the issue.

Reviewed-on: #121
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #121.
This commit is contained in:
2026-05-09 14:38:52 +02:00
committed by t.behrendt
parent eb9b335789
commit d6d9c63b3d
+4 -1
View File
@@ -43,7 +43,8 @@ export function ts3gotifyFactory(
ts3Client: TeamSpeak,
gotifyClient: Gotify,
gotifyConfig: GotifyConfig,
logger: Logger
logger: Logger,
pingInterval = 2_500
) {
let reconnectInProgress = false;
@@ -108,6 +109,8 @@ export function ts3gotifyFactory(
}
}
setInterval(() => ts3Client.version(true), pingInterval);
ts3Client.on("close", async () => {
await reconnectWithBackoff();
});