respond to review comments
This commit is contained in:
@@ -261,15 +261,16 @@ listeners:
|
||||
# sign up in a short space of time never to return after their initial
|
||||
# session.
|
||||
#
|
||||
# 'mau_suppress_alerting' is a means of limiting client side alerting
|
||||
# 'mau_limit_alerting' is a means of limiting client side alerting
|
||||
# should the mau limit be reached. This is useful for small instances
|
||||
# where the admin has 5 mau seats (say) for 5 specific people and no
|
||||
# interest increasing the mau limit further. Defaults to False.
|
||||
# interest increasing the mau limit further. Defaults to True, which
|
||||
# means that alerting is enabled
|
||||
#
|
||||
#limit_usage_by_mau: False
|
||||
#max_mau_value: 50
|
||||
#mau_trial_days: 2
|
||||
#mau_suppress_alerting: True
|
||||
#mau_limit_alerting: False
|
||||
|
||||
# If enabled, the metrics for the number of monthly active users will
|
||||
# be populated, however no one will be limited. If limit_usage_by_mau
|
||||
|
||||
@@ -171,7 +171,7 @@ class ServerConfig(Config):
|
||||
)
|
||||
|
||||
self.mau_trial_days = config.get("mau_trial_days", 0)
|
||||
self.mau_suppress_alerting = config.get("mau_suppress_alerting", False)
|
||||
self.mau_limit_alerting = config.get("mau_limit_alerting", True)
|
||||
|
||||
# How long to keep redacted events in the database in unredacted form
|
||||
# before redacting them.
|
||||
@@ -696,15 +696,16 @@ class ServerConfig(Config):
|
||||
# sign up in a short space of time never to return after their initial
|
||||
# session.
|
||||
#
|
||||
# 'mau_suppress_alerting' is a means of limiting client side alerting
|
||||
# 'mau_limit_alerting' is a means of limiting client side alerting
|
||||
# should the mau limit be reached. This is useful for small instances
|
||||
# where the admin has 5 mau seats (say) for 5 specific people and no
|
||||
# interest increasing the mau limit further. Defaults to False.
|
||||
# interest increasing the mau limit further. Defaults to True, which
|
||||
# means that alerting is enabled
|
||||
#
|
||||
#limit_usage_by_mau: False
|
||||
#max_mau_value: 50
|
||||
#mau_trial_days: 2
|
||||
#mau_suppress_alerting: True
|
||||
#mau_limit_alerting: False
|
||||
|
||||
# If enabled, the metrics for the number of monthly active users will
|
||||
# be populated, however no one will be limited. If limit_usage_by_mau
|
||||
|
||||
@@ -70,7 +70,7 @@ class ResourceLimitsServerNotices(object):
|
||||
return
|
||||
|
||||
if not self._server_notices_manager.is_enabled():
|
||||
# Don't try and send server notices unles they've been enabled
|
||||
# Don't try and send server notices unless they've been enabled
|
||||
return
|
||||
|
||||
timestamp = yield self._store.user_last_seen_monthly_active(user_id)
|
||||
@@ -91,7 +91,7 @@ class ResourceLimitsServerNotices(object):
|
||||
currently_blocked, ref_events = yield self._is_room_currently_blocked(room_id)
|
||||
|
||||
try:
|
||||
if self._config.mau_suppress_alerting:
|
||||
if not self._config.mau_limit_alerting:
|
||||
# Alerting disabled, reset room if necessary and return
|
||||
if currently_blocked:
|
||||
content = {"pinned": ref_events}
|
||||
|
||||
@@ -163,7 +163,7 @@ class TestResourceLimitsServerNotices(unittest.HomeserverTestCase):
|
||||
Test that when server is over MAU limit and alerting is suppressed, then
|
||||
an alert message is not sent into the room
|
||||
"""
|
||||
self.hs.config.mau_suppress_alerting = True
|
||||
self.hs.config.mau_limit_alerting = False
|
||||
self._rlsn._auth.check_auth_blocking = Mock(
|
||||
side_effect=ResourceLimitError(403, "foo")
|
||||
)
|
||||
@@ -176,7 +176,7 @@ class TestResourceLimitsServerNotices(unittest.HomeserverTestCase):
|
||||
When the room is already in a blocked state, test that when alerting
|
||||
is suppressed that the room is returned to an unblocked state.
|
||||
"""
|
||||
self.hs.config.mau_suppress_alerting = True
|
||||
self.hs.config.mau_limit_alerting = False
|
||||
self._rlsn._auth.check_auth_blocking = Mock(
|
||||
side_effect=ResourceLimitError(403, "foo")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user