summary refs log tree commit diff
path: root/synapse/storage/data_stores
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-01-28 13:05:24 +0000
committerGitHub <noreply@github.com>2020-01-28 13:05:24 +0000
commitbdbeeb94ecc8e99f1401174df220a38e130db164 (patch)
tree80d87cea462e3b296c5af57a4a941f41fbaa4bea /synapse/storage/data_stores
parentFixup changelog (diff)
downloadsynapse-bdbeeb94ecc8e99f1401174df220a38e130db164.tar.xz
Fix setting `mau_limit_reserved_threepids` config (#6793)
Calling the invalidation function during initialisation of the data
stores introduces a circular dependency, causing Synapse to fail to
start.
Diffstat (limited to 'synapse/storage/data_stores')
-rw-r--r--synapse/storage/data_stores/main/monthly_active_users.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/storage/data_stores/main/monthly_active_users.py b/synapse/storage/data_stores/main/monthly_active_users.py
index 89a41542a3..1507a14e09 100644
--- a/synapse/storage/data_stores/main/monthly_active_users.py
+++ b/synapse/storage/data_stores/main/monthly_active_users.py
@@ -121,7 +121,13 @@ class MonthlyActiveUsersStore(MonthlyActiveUsersWorkerStore):
             if user_id:
                 is_support = self.is_support_user_txn(txn, user_id)
                 if not is_support:
-                    self.upsert_monthly_active_user_txn(txn, user_id)
+                    # We do this manually here to avoid hitting #6791
+                    self.db.simple_upsert_txn(
+                        txn,
+                        table="monthly_active_users",
+                        keyvalues={"user_id": user_id},
+                        values={"timestamp": int(self._clock.time_msec())},
+                    )
             else:
                 logger.warning("mau limit reserved threepid %s not found in db" % tp)