Make Notifier.CurrentPosition() respect stream lock

Signed-off-by: Alex Chen <minecnly@gmail.com>
This commit is contained in:
Cnly 2019-06-27 04:33:45 +08:00
parent 74fd292403
commit aeceacd917

View file

@ -141,6 +141,9 @@ func (n *Notifier) Load(ctx context.Context, db *storage.SyncServerDatasource) e
// CurrentPosition returns the current stream position
func (n *Notifier) CurrentPosition() types.SyncPosition {
n.streamLock.Lock()
defer n.streamLock.Unlock()
return n.currPos
}