提交 2a264db8 编写于 作者: K Kegan Dougal

Don't tightloop if currentPos is 0

上级 cb5081b3
......@@ -119,6 +119,8 @@ func (rp *RequestPool) waitForEvents(req syncRequest) types.StreamPosition {
}
func (rp *RequestPool) currentSyncForUser(req syncRequest) (*types.Response, error) {
currentPos := rp.waitForEvents(req)
if req.since == types.StreamPosition(0) {
pos, data, err := rp.db.CompleteSync(req.userID, req.limit)
if err != nil {
......@@ -135,8 +137,6 @@ func (rp *RequestPool) currentSyncForUser(req syncRequest) (*types.Response, err
return res, nil
}
currentPos := rp.waitForEvents(req)
// TODO: handle ignored users
data, err := rp.db.IncrementalSync(req.userID, req.since, currentPos, req.limit)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册