mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-06 13:43:09 -06:00
Actually return a response with timeout=0
This commit is contained in:
parent
30fc50d099
commit
0cb04005db
|
|
@ -381,11 +381,14 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
|
||||||
// they weren't always doing, resulting in flakey tests.
|
// they weren't always doing, resulting in flakey tests.
|
||||||
if !syncReq.Response.HasUpdates() {
|
if !syncReq.Response.HasUpdates() {
|
||||||
syncReq.Since = currentPos
|
syncReq.Since = currentPos
|
||||||
syncReq.Timeout = syncReq.Timeout - time.Since(startTime)
|
// do not loop again if the ?timeout= is 0 as that means "return immediately"
|
||||||
if syncReq.Timeout < 0 {
|
if syncReq.Timeout > 0 {
|
||||||
syncReq.Timeout = 0
|
syncReq.Timeout = syncReq.Timeout - time.Since(startTime)
|
||||||
|
if syncReq.Timeout < 0 {
|
||||||
|
syncReq.Timeout = 0
|
||||||
|
}
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue