mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 09:13:09 -06:00
Fix position update
This commit is contained in:
parent
7d3356f563
commit
8fdcd97108
|
|
@ -85,7 +85,7 @@ func (s *OutputClientDataConsumer) onMessage(msg *sarama.ConsumerMessage) error
|
||||||
"room_id": output.RoomID,
|
"room_id": output.RoomID,
|
||||||
}).Info("received data from client API server")
|
}).Info("received data from client API server")
|
||||||
|
|
||||||
pduPos, err := s.db.UpsertAccountData(
|
streamPos, err := s.db.UpsertAccountData(
|
||||||
context.TODO(), string(msg.Key), output.RoomID, output.Type,
|
context.TODO(), string(msg.Key), output.RoomID, output.Type,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -96,8 +96,8 @@ func (s *OutputClientDataConsumer) onMessage(msg *sarama.ConsumerMessage) error
|
||||||
}).Panicf("could not save account data")
|
}).Panicf("could not save account data")
|
||||||
}
|
}
|
||||||
|
|
||||||
s.streams.AccountDataStreamProvider.Advance(pduPos)
|
s.streams.AccountDataStreamProvider.Advance(streamPos)
|
||||||
s.notifier.OnNewAccountData(string(msg.Key), types.StreamingToken{AccountDataPosition: pduPos})
|
s.notifier.OnNewAccountData(string(msg.Key), types.StreamingToken{AccountDataPosition: streamPos})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
|
||||||
|
|
||||||
case <-userStreamListener.GetNotifyChannel(syncReq.Since):
|
case <-userStreamListener.GetNotifyChannel(syncReq.Since):
|
||||||
syncReq.Log.Debugln("Responding to sync after wake-up")
|
syncReq.Log.Debugln("Responding to sync after wake-up")
|
||||||
currentPos = userStreamListener.GetSyncPosition()
|
currentPos.ApplyUpdates(userStreamListener.GetSyncPosition())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
syncReq.Log.Debugln("Responding to sync immediately")
|
syncReq.Log.Debugln("Responding to sync immediately")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue