Add notes

This commit is contained in:
Kegan Dougal 2017-04-07 17:08:59 +01:00
parent 465ddc2204
commit ad5328c453

View file

@ -74,7 +74,6 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request) util.JSONRespons
"userID": userID,
"since": since,
"timeout": timeout,
"current": rp.currPos,
}).Info("Incoming /sync request")
// Set up a timer based on the provided timeout value.
@ -94,6 +93,9 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request) util.JSONRespons
}
}()
// TODO: Spawn off a 3rd goroutine to do this work so we can simply race
// with the timeout to determine what to return to the client.
res, err := rp.currentSyncForUser(syncReq)
close(done) // signal that the work is complete
if err != nil {