summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-09-09 13:31:00 +0100
committerErik Johnston <erik@matrix.org>2019-09-09 13:31:00 +0100
commit916c69722833dd94c53d0fedeec8cc42d2085e73 (patch)
treee5b23a72d09168f01c8797f9e0477fa5bdb81da8 /synapse
parentDon't start looping call unless enabled (diff)
downloadsynapse-916c69722833dd94c53d0fedeec8cc42d2085e73.tar.xz
Fixup comment
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/events.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 9ef7aefd97..4484ae7ce0 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -269,7 +269,7 @@ class EventsStore(
             )
 
         if self.hs.config.redaction_retention_period is not None:
-            hs.get_clock().looping_call(_censor_redactions, 10 * 60 * 1000)
+            hs.get_clock().looping_call(_censor_redactions, 5 * 60 * 1000)
 
     @defer.inlineCallbacks
     def _read_forward_extremities(self):
@@ -1574,9 +1574,17 @@ class EventsStore(
             self._clock.time_msec() - self.hs.config.redaction_retention_period
         )
 
-        # We fetch all redactions that point to an event that we have that has
-        # a stream ordering from over a month ago, that we haven't yet censored
-        # in the DB.
+        # We fetch all redactions that:
+        #   1. point to an event we have that has,
+        #   2. has a stream ordering from before the cut off, and
+        #   3. we haven't yet censored.
+        #
+        # This is limited to 100 events to ensure that we don't try and do too
+        # much at once. We'll get called again so this should eventually catch
+        # up.
+        #
+        # We use the range [-max_pos, max_pos] to handle backfilled events,
+        # which are given negative stream ordering.
         sql = """
             SELECT er.event_id, redacts FROM redactions
             INNER JOIN events AS er USING (event_id)