Use direct references for configuration variables (part 6). (#10916)

This commit is contained in:
Patrick Cloke 2021-09-29 06:44:15 -04:00 committed by GitHub
parent 8cef1ab2ac
commit 94b620a5ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 141 additions and 132 deletions

View file

@ -36,7 +36,7 @@ class CensorEventsStore(EventsWorkerStore, CacheInvalidationWorkerStore, SQLBase
if (
hs.config.worker.run_background_tasks
and self.hs.config.redaction_retention_period is not None
and self.hs.config.server.redaction_retention_period is not None
):
hs.get_clock().looping_call(self._censor_redactions, 5 * 60 * 1000)
@ -48,7 +48,7 @@ class CensorEventsStore(EventsWorkerStore, CacheInvalidationWorkerStore, SQLBase
By censor we mean update the event_json table with the redacted event.
"""
if self.hs.config.redaction_retention_period is None:
if self.hs.config.server.redaction_retention_period is None:
return
if not (
@ -60,7 +60,9 @@ class CensorEventsStore(EventsWorkerStore, CacheInvalidationWorkerStore, SQLBase
# created.
return
before_ts = self._clock.time_msec() - self.hs.config.redaction_retention_period
before_ts = (
self._clock.time_msec() - self.hs.config.server.redaction_retention_period
)
# We fetch all redactions that:
# 1. point to an event we have,