mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Set sensible default timeout if not provided
This commit is contained in:
parent
61bd94fe4b
commit
d1e253da21
@ -64,8 +64,7 @@ export class SlidingSyncConnection {
|
||||
this.abortController = new AbortController();
|
||||
const jsonBody = JSON.stringify(reqBody);
|
||||
let resp = await fetch(
|
||||
"/_matrix/client/v3/sync?timeout=20000" +
|
||||
(pos ? "&pos=" + pos : ""),
|
||||
"/_matrix/client/v3/sync" + (pos ? "?pos=" + pos : ""),
|
||||
{
|
||||
signal: this.abortController.signal,
|
||||
method: "POST",
|
||||
|
@ -130,7 +130,7 @@ func (h *SyncLiveHandler) serve(w http.ResponseWriter, req *http.Request) error
|
||||
|
||||
var timeout int
|
||||
if req.URL.Query().Get("timeout") == "" {
|
||||
timeout = sync3.DefaultTimeoutSecs
|
||||
timeout = sync3.DefaultTimeoutMSecs
|
||||
} else {
|
||||
timeout64, herr := parseIntFromQuery(req.URL, "timeout")
|
||||
if herr != nil {
|
||||
|
@ -17,7 +17,7 @@ var (
|
||||
SortBy = []string{SortByHighlightCount, SortByName, SortByNotificationCount, SortByRecency}
|
||||
|
||||
DefaultTimelineLimit = int64(20)
|
||||
DefaultTimeoutSecs = 10
|
||||
DefaultTimeoutMSecs = 10 * 1000 // 10s
|
||||
)
|
||||
|
||||
type Request struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user