summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-23 13:25:44 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-23 13:25:44 +0000
commit714dca387dba58a019684ac2fc6d401c74f035e2 (patch)
treec8d3285c2c2ebbfd66d7732e01dd427d20e3a91f
parentAdd `rooms.room_version` column (#6729) (diff)
parentFix setting `mau_limit_reserved_threepids` config (#6793) (diff)
downloadsynapse-714dca387dba58a019684ac2fc6d401c74f035e2.tar.xz
Fix setting `mau_limit_reserved_threepids` config (#6793)
* commit 'bdbeeb94e':
  Fix setting `mau_limit_reserved_threepids` config (#6793)
-rw-r--r--changelog.d/6793.bugfix1
-rw-r--r--synapse/storage/data_stores/main/monthly_active_users.py8
2 files changed, 8 insertions, 1 deletions
diff --git a/changelog.d/6793.bugfix b/changelog.d/6793.bugfix
new file mode 100644

index 0000000000..564d4596ea --- /dev/null +++ b/changelog.d/6793.bugfix
@@ -0,0 +1 @@ +Fix bug where setting `mau_limit_reserved_threepids` config would cause Synapse to refuse to start. 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)