1
0
Fork 0
mirror of https://codeberg.org/june64/mrvc.git synced 2026-01-10 16:06:33 +01:00

avoid waiting on long timeouts for shorter program runtime

Avoid waiting on long timeouts by moving from default timeout of 30
seconds to a custom timeout of 5 seconds.
This commit is contained in:
June 2025-08-15 21:48:17 +02:00
commit 7b8102b4f0
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0

View file

@ -8,6 +8,7 @@ import (
"sort"
"strings"
"sync"
"time"
"github.com/hashicorp/go-version"
"github.com/matrix-org/gomatrixserverlib/fclient"
@ -256,6 +257,7 @@ func main() {
token := os.Getenv("MATRIX_TOKEN")
room := os.Getenv("MATRIX_ROOM")
verbose := false
timeoutSeconds := 5
client, err := mautrix.NewClient(
homeserver,
@ -267,6 +269,7 @@ func main() {
}
federationClient := fclient.NewClient(
fclient.WithWellKnownSRVLookups(true),
fclient.WithTimeout(time.Second*time.Duration(timeoutSeconds)),
)
joinedMembers, err := client.JoinedMembers(context.Background(), id.RoomID(room))