mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Linting and fix bug whereby we didn't send updated dl tokens to the client causing a tightloop on /sync sometimes
This commit is contained in:
parent
44a41836f0
commit
ed6566b66f
|
|
@ -116,7 +116,7 @@ func (u *DeviceListUpdater) Start() error {
|
||||||
// This is important for sytest as when the /send transaction 200 OKs it assumes that
|
// This is important for sytest as when the /send transaction 200 OKs it assumes that
|
||||||
// keys have been fetched and will then issue requests to /keys/query which it expects
|
// keys have been fetched and will then issue requests to /keys/query which it expects
|
||||||
// to be satisfied from the cache (which it won't be if we haven't processed it yet).
|
// to be satisfied from the cache (which it won't be if we haven't processed it yet).
|
||||||
ch := make(chan gomatrixserverlib.ServerName, 0)
|
ch := make(chan gomatrixserverlib.ServerName)
|
||||||
u.workerChans[i] = ch
|
u.workerChans[i] = ch
|
||||||
go u.worker(ch)
|
go u.worker(ch)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,13 @@ func DeviceListCatchup(
|
||||||
userSet[userID] = true
|
userSet[userID] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// set the new token
|
||||||
|
to.SetLog(DeviceListLogName, &types.LogPosition{
|
||||||
|
Partition: queryRes.Partition,
|
||||||
|
Offset: queryRes.Offset,
|
||||||
|
})
|
||||||
|
res.NextBatch = to.String()
|
||||||
|
|
||||||
return hasNew, nil
|
return hasNew, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,9 @@ type StreamingToken struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *StreamingToken) SetLog(name string, lp *LogPosition) {
|
func (t *StreamingToken) SetLog(name string, lp *LogPosition) {
|
||||||
|
if t.logs == nil {
|
||||||
|
t.logs = make(map[string]*LogPosition)
|
||||||
|
}
|
||||||
t.logs[name] = lp
|
t.logs[name] = lp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue