mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Fixup comments
This commit is contained in:
parent
99f5206063
commit
5503b9d10b
@ -149,13 +149,13 @@ func (h *PollerMap) NumPollers() (count int) {
|
||||
return
|
||||
}
|
||||
|
||||
// EnsurePolling makes sure there is a poller for this user, making one if need be.
|
||||
// EnsurePolling makes sure there is a poller for this device, making one if need be.
|
||||
// Blocks until at least 1 sync is done if and only if the poller was just created.
|
||||
// This ensures that calls to the database will return data.
|
||||
// Guarantees only 1 poller will be running per deviceID.
|
||||
// Note that we will immediately return if there is a poller for the same user but a different device.
|
||||
// We do this to allow for logins on clients to be snappy fast, even though they won't yet have the
|
||||
// to-device msgs to decrypt E2EE roms.
|
||||
// to-device msgs to decrypt E2EE rooms.
|
||||
func (h *PollerMap) EnsurePolling(pid PollerID, accessToken, v2since string, isStartup bool, logger zerolog.Logger) {
|
||||
h.pollerMu.Lock()
|
||||
if !h.executorRunning {
|
||||
|
@ -44,11 +44,6 @@ func NewEnsurePoller(notifier pubsub.Notifier) *EnsurePoller {
|
||||
func (p *EnsurePoller) EnsurePolling(pid sync2.PollerID, tokenHash string) {
|
||||
p.mu.Lock()
|
||||
// do we need to wait?
|
||||
// TODO: this lookup is based on (user, device) pair. If the same user logs in on
|
||||
// another device, we will wait for the poller to make an initial sync. We could do
|
||||
// better here by using the data we've accumulated for the first device. However
|
||||
// that wouldn't include any to-device messages, so encrypted messages would be
|
||||
// undecrypted.
|
||||
if p.pendingPolls[pid].done {
|
||||
p.mu.Unlock()
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user