mirror of
https://codeberg.org/june64/mrvc.git
synced 2026-01-09 23:52:54 +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:
parent
f1ffe9b4cd
commit
7b8102b4f0
1 changed files with 3 additions and 0 deletions
3
main.go
3
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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue