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,6 +381,8 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
|
|||
// they weren't always doing, resulting in flakey tests.
|
||||
if !syncReq.Response.HasUpdates() {
|
||||
syncReq.Since = currentPos
|
||||
// do not loop again if the ?timeout= is 0 as that means "return immediately"
|
||||
if syncReq.Timeout > 0 {
|
||||
syncReq.Timeout = syncReq.Timeout - time.Since(startTime)
|
||||
if syncReq.Timeout < 0 {
|
||||
syncReq.Timeout = 0
|
||||
|
|
@ -388,6 +390,7 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
|
|||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusOK,
|
||||
|
|
|
|||
Loading…
Reference in a new issue