summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-05-02 17:45:44 +0100
committerGitHub <noreply@github.com>2023-05-02 16:45:44 +0000
commit4de271a7fcde6b46611ba2aa9d45cdc6cc7275ab (patch)
treee025071d7af46c8d878629f2dfba99aec98e292a /synapse/config
parentReduce the size of the HTTP connection pool for non-pushers. (#15514) (diff)
downloadsynapse-4de271a7fcde6b46611ba2aa9d45cdc6cc7275ab.tar.xz
Allow adding random delay to push (#15516)
This is to discourage timing based profiling on the push gateways.
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/push.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/config/push.py b/synapse/config/push.py
index 3b5378e6ea..8177ff52e2 100644
--- a/synapse/config/push.py
+++ b/synapse/config/push.py
@@ -42,11 +42,17 @@ class PushConfig(Config):
 
         # Now check for the one in the 'email' section and honour it,
         # with a warning.
-        push_config = config.get("email") or {}
-        redact_content = push_config.get("redact_content")
+        email_push_config = config.get("email") or {}
+        redact_content = email_push_config.get("redact_content")
         if redact_content is not None:
             print(
                 "The 'email.redact_content' option is deprecated: "
                 "please set push.include_content instead"
             )
             self.push_include_content = not redact_content
+
+        # Whether to apply a random delay to outbound push.
+        self.push_jitter_delay_ms = None
+        push_jitter_delay = push_config.get("jitter_delay", None)
+        if push_jitter_delay:
+            self.push_jitter_delay_ms = self.parse_duration(push_jitter_delay)