mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 01:13:10 -06:00
Fix timer never being stopped
Even on a full request the timer needs to be stopped if it didn't stop yet
This commit is contained in:
parent
653e7dc21f
commit
15a4ed0333
|
|
@ -77,9 +77,7 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *authtype
|
||||||
// We stop the timer BEFORE calculating the response so the cpu work
|
// We stop the timer BEFORE calculating the response so the cpu work
|
||||||
// done to calculate the response is not timed. This stops us from
|
// done to calculate the response is not timed. This stops us from
|
||||||
// doing lots of work then timing out and sending back an empty response.
|
// doing lots of work then timing out and sending back an empty response.
|
||||||
if syncReq.timeout != 0 && syncReq.since != types.StreamPosition(0) && !syncReq.wantFullState {
|
timer.Stop()
|
||||||
timer.Stop()
|
|
||||||
}
|
|
||||||
syncData, err := rp.currentSyncForUser(*syncReq, currentPos)
|
syncData, err := rp.currentSyncForUser(*syncReq, currentPos)
|
||||||
var res util.JSONResponse
|
var res util.JSONResponse
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue