mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 21:03:51 +01:00
Only start censor background job after indices are created
This commit is contained in:
parent
52fe9788bc
commit
cc5f6eb608
2 changed files with 9 additions and 2 deletions
|
@ -1053,6 +1053,13 @@ class EventsStore(
|
|||
if self.hs.config.redaction_retention_period is None:
|
||||
return
|
||||
|
||||
if self.db.updates.has_completed_background_update(
|
||||
"redactions_have_censored_ts_idx"
|
||||
):
|
||||
# We don't want to run this until the appropriate index has been
|
||||
# created.
|
||||
return
|
||||
|
||||
before_ts = self._clock.time_msec() - self.hs.config.redaction_retention_period
|
||||
|
||||
# We fetch all redactions that:
|
||||
|
|
|
@ -18,5 +18,5 @@ ALTER TABLE redactions ADD COLUMN received_ts BIGINT;
|
|||
INSERT INTO background_updates (update_name, progress_json) VALUES
|
||||
('redactions_received_ts', '{}');
|
||||
|
||||
INSERT INTO background_updates (update_name, progress_json) VALUES
|
||||
('redactions_have_censored_ts_idx', '{}');
|
||||
INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
|
||||
('redactions_have_censored_ts_idx', '{}', 'redactions_have_censored_idx');
|
||||
|
|
Loading…
Reference in a new issue