From 6a544ce34b0a20a31d605e444937c6ebd9fe628a Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 10 Apr 2017 11:39:12 +0100 Subject: [PATCH] Clarifications --- .../matrix-org/dendrite/clientapi/sync/requestpool.go | 2 -- src/github.com/matrix-org/dendrite/common/consumers.go | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/sync/requestpool.go b/src/github.com/matrix-org/dendrite/clientapi/sync/requestpool.go index 549adb95c..9bac41ef4 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/sync/requestpool.go +++ b/src/github.com/matrix-org/dendrite/clientapi/sync/requestpool.go @@ -1,7 +1,6 @@ package sync import ( - "fmt" "net/http" "strconv" "sync" @@ -117,7 +116,6 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request) util.JSONRespons func (rp *RequestPool) OnNewEvent(ev *gomatrixserverlib.Event, pos syncStreamPosition) { // update the current position in a guard and then notify all /sync streams rp.cond.L.Lock() - fmt.Println("OnNewEvent =>", ev.EventID(), " pos=", pos, " old_pos=", rp.currPos) rp.currPos = pos rp.cond.L.Unlock() diff --git a/src/github.com/matrix-org/dendrite/common/consumers.go b/src/github.com/matrix-org/dendrite/common/consumers.go index 9d16fe47d..bf7a64145 100644 --- a/src/github.com/matrix-org/dendrite/common/consumers.go +++ b/src/github.com/matrix-org/dendrite/common/consumers.go @@ -67,6 +67,8 @@ func (c *ContinualConsumer) Start() error { } for _, offset := range storedOffsets { // We've already processed events from this partition so advance the offset to where we got to. + // Offsets are provided with each message, so if we use the same offset on startup then we'll + // get the same message a 2nd time, so increment 1 to indicate the next offset. offsets[offset.Partition] = 1 + offset.Offset }