Clarifications

This commit is contained in:
Kegan Dougal 2017-04-10 11:39:12 +01:00
parent bb22e52ef4
commit 6a544ce34b
2 changed files with 2 additions and 2 deletions

View file

@ -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()

View file

@ -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
}