summary refs log tree commit diff
path: root/synapse/storage/monthly_active_users.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-17 12:44:26 +0000
committerGitHub <noreply@github.com>2018-08-17 12:44:26 +0000
commit69c49d3fa3dc91ff6cbbadb52dc14e60cb063ecc (patch)
treea2a6e5b2b873ffb119d6124e4b9feae56bc22bbd /synapse/storage/monthly_active_users.py
parentadd new error type ResourceLimit (diff)
parentMerge pull request #3708 from matrix-org/neilj/resource_Limit_block_event_cre... (diff)
downloadsynapse-69c49d3fa3dc91ff6cbbadb52dc14e60cb063ecc.tar.xz
Merge branch 'develop' into neilj/limit_exceeded_error
Diffstat (limited to 'synapse/storage/monthly_active_users.py')
-rw-r--r--synapse/storage/monthly_active_users.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py

index 7e417f811e..06f9a75a97 100644 --- a/synapse/storage/monthly_active_users.py +++ b/synapse/storage/monthly_active_users.py
@@ -96,7 +96,10 @@ class MonthlyActiveUsersStore(SQLBaseStore): # While Postgres does not require 'LIMIT', but also does not support # negative LIMIT values. So there is no way to write it that both can # support - query_args = [self.hs.config.max_mau_value] + safe_guard = self.hs.config.max_mau_value - len(self.reserved_users) + # Must be greater than zero for postgres + safe_guard = safe_guard if safe_guard > 0 else 0 + query_args = [safe_guard] base_sql = """ DELETE FROM monthly_active_users