mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-27 03:58:06 +03:00
Only fetch with row ts and count > 1
This commit is contained in:
parent
05b9f48ee5
commit
d3169e8d28
1 changed files with 2 additions and 1 deletions
|
@ -552,9 +552,10 @@ class DeviceStore(SQLBaseStore):
|
||||||
SELECT destination, user_id, max(stream_id) as stream_id
|
SELECT destination, user_id, max(stream_id) as stream_id
|
||||||
FROM device_lists_outbound_pokes
|
FROM device_lists_outbound_pokes
|
||||||
GROUP BY destination, user_id
|
GROUP BY destination, user_id
|
||||||
|
HAVING min(ts) < ? AND count(*) > 1
|
||||||
"""
|
"""
|
||||||
|
|
||||||
txn.execute(select_sql)
|
txn.execute(select_sql, (yesterday,))
|
||||||
rows = txn.fetchall()
|
rows = txn.fetchall()
|
||||||
|
|
||||||
if not rows:
|
if not rows:
|
||||||
|
|
Loading…
Reference in a new issue