diff --git a/main.go b/main.go index ceda106..2b59ee9 100644 --- a/main.go +++ b/main.go @@ -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))