mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 03:13:11 -06:00
Make Notifier.CurrentPosition() respect stream lock
Signed-off-by: Alex Chen <minecnly@gmail.com>
This commit is contained in:
parent
74fd292403
commit
aeceacd917
|
|
@ -141,6 +141,9 @@ func (n *Notifier) Load(ctx context.Context, db *storage.SyncServerDatasource) e
|
||||||
|
|
||||||
// CurrentPosition returns the current stream position
|
// CurrentPosition returns the current stream position
|
||||||
func (n *Notifier) CurrentPosition() types.SyncPosition {
|
func (n *Notifier) CurrentPosition() types.SyncPosition {
|
||||||
|
n.streamLock.Lock()
|
||||||
|
defer n.streamLock.Unlock()
|
||||||
|
|
||||||
return n.currPos
|
return n.currPos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue