summary refs log tree commit diff
path: root/synapse/config/registration.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-05-31 09:54:46 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-05-31 09:54:46 +0100
commit847b9dcd1c9d7d7a43333e85f69dc78471095475 (patch)
treefde736222c454bb37707b95f99a79d471ece376d /synapse/config/registration.py
parentTypo (diff)
downloadsynapse-847b9dcd1c9d7d7a43333e85f69dc78471095475.tar.xz
Make max_delta equal to period * 10%
Diffstat (limited to 'synapse/config/registration.py')
-rw-r--r--synapse/config/registration.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/synapse/config/registration.py b/synapse/config/registration.py
index b4fd4af368..1835b4b1f3 100644
--- a/synapse/config/registration.py
+++ b/synapse/config/registration.py
@@ -39,9 +39,7 @@ class AccountValidityConfig(Config):
             else:
                 self.renew_email_subject = "Renew your %(app)s account"
 
-            self.startup_job_max_delta = self.parse_duration(
-                config.get("startup_job_max_delta", 0),
-            )
+            self.startup_job_max_delta = self.period * 10. / 100.
 
         if self.renew_by_email_enabled and "public_baseurl" not in synapse_config:
             raise ConfigError("Can't send renewal emails without 'public_baseurl'")
@@ -133,20 +131,15 @@ class RegistrationConfig(Config):
         # This means that, if a validity period is set, and Synapse is restarted (it will
         # then derive an expiration date from the current validity period), and some time
         # after that the validity period changes and Synapse is restarted, the users'
-        # expiration dates won't be updated unless their account is manually renewed.
-        #
-        # If set, the ``startup_job_max_delta`` optional setting will make the startup job
-        # described above set a random expiration date between t + period  and
-        # t + period + startup_job_max_delta, t being the date and time at which the job
-        # sets the expiration date for a given user. This is useful for server admins that
-        # want to avoid Synapse sending a lot of renewal emails at once.
+        # expiration dates won't be updated unless their account is manually renewed. This
+        # date will be randomly selected within a range [now + period ; now + period + d],
+        # where d is equal to 10% of the validity period.
         #
         #account_validity:
         #  enabled: True
         #  period: 6w
         #  renew_at: 1w
         #  renew_email_subject: "Renew your %%(app)s account"
-        #  startup_job_max_delta: 2d
 
         # The user must provide all of the below types of 3PID when registering.
         #