mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
More limiting
This commit is contained in:
parent
9f7ab9c608
commit
0c9d1cfe18
|
|
@ -72,7 +72,7 @@ const selectMaxPresenceSQL = "" +
|
|||
const selectPresenceAfter = "" +
|
||||
" SELECT id, user_id, presence, status_msg, last_active_ts" +
|
||||
" FROM syncapi_presence" +
|
||||
" WHERE id > $1 ORDER BY last_active_ts DESC LIMIT $2"
|
||||
" WHERE id > $1 ORDER BY id DESC, last_active_ts DESC LIMIT $2"
|
||||
|
||||
type presenceStatements struct {
|
||||
upsertPresenceStmt *sql.Stmt
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ const selectMaxPresenceSQL = "" +
|
|||
const selectPresenceAfter = "" +
|
||||
" SELECT id, user_id, presence, status_msg, last_active_ts" +
|
||||
" FROM syncapi_presence" +
|
||||
" WHERE id > $1 ORDER BY last_active_ts DESC LIMIT $2"
|
||||
" WHERE id > $1 ORDER BY id DESC, last_active_ts DESC LIMIT $2"
|
||||
|
||||
type presenceStatements struct {
|
||||
db *sql.DB
|
||||
|
|
|
|||
|
|
@ -135,6 +135,9 @@ func (p *PresenceStreamProvider) IncrementalSync(
|
|||
if presence.StreamPos > lastPos {
|
||||
lastPos = presence.StreamPos
|
||||
}
|
||||
if len(req.Response.Presence.Events) == req.Filter.Presence.Limit {
|
||||
break
|
||||
}
|
||||
p.cache.Store(cacheKey, presence)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue