summary refs log tree commit diff
path: root/synapse/storage/data_stores
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-10-31 14:49:41 +0000
committerBrendan Abolivier <babolivier@matrix.org>2019-11-04 09:56:10 +0000
commit911b03ca312160bd8f80f010da4eaf63d7f602da (patch)
treef4b3cfb4cb0c819493591c44d1dae4b72dab000a /synapse/storage/data_stores
parentUse a sensible default value for labels (diff)
downloadsynapse-911b03ca312160bd8f80f010da4eaf63d7f602da.tar.xz
Don't try to process events we already have a label for
Diffstat (limited to 'synapse/storage/data_stores')
-rw-r--r--synapse/storage/data_stores/main/events_bg_updates.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/data_stores/main/events_bg_updates.py b/synapse/storage/data_stores/main/events_bg_updates.py
index 448048e11d..c8168f6926 100644
--- a/synapse/storage/data_stores/main/events_bg_updates.py
+++ b/synapse/storage/data_stores/main/events_bg_updates.py
@@ -518,7 +518,8 @@ class EventsBackgroundUpdatesStore(BackgroundUpdateStore):
             txn.execute(
                 """
                 SELECT event_id, json FROM event_json
-                WHERE event_id > ?
+                LEFT JOIN event_labels USING (event_id)
+                WHERE event_id > ? AND label IS NULL
                 LIMIT ?
                 """,
                 (last_event_id, batch_size)