diff options
author | David Baker <dave@matrix.org> | 2016-04-29 20:14:55 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2016-04-29 20:14:55 +0100 |
commit | b084e4d963f2df377dfe98b6d9645fa9183a368b (patch) | |
tree | bc89148264c519a9fda50b8f82569e85b03c6d74 | |
parent | Remove unused function (diff) | |
download | synapse-b084e4d963f2df377dfe98b6d9645fa9183a368b.tar.xz |
Add constant for throttle multiplier
Diffstat (limited to '')
-rw-r--r-- | synapse/push/emailpusher.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/push/emailpusher.py b/synapse/push/emailpusher.py index c10deded06..3a13c7485a 100644 --- a/synapse/push/emailpusher.py +++ b/synapse/push/emailpusher.py @@ -30,6 +30,7 @@ DELAY_BEFORE_MAIL_MS = 2 * 60 * 1000 THROTTLE_START_MS = 2 * 60 * 1000 THROTTLE_MAX_MS = (2 * 60 * 1000) * (2 ** 11) # ~3 days +THROTTLE_MULTIPLIER = 2 # If no event triggers a notification for this long after the previous, # the throttle is released. @@ -231,7 +232,7 @@ class EmailPusher(object): new_throttle_ms = THROTTLE_START_MS else: new_throttle_ms = min( - current_throttle_ms * 2, + current_throttle_ms * THROTTLE_MULTIPLIER, THROTTLE_MAX_MS ) self.throttle_params[room_id] = { |