diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-05-31 09:54:46 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-05-31 09:54:46 +0100 |
commit | 847b9dcd1c9d7d7a43333e85f69dc78471095475 (patch) | |
tree | fde736222c454bb37707b95f99a79d471ece376d /synapse/storage | |
parent | Typo (diff) | |
download | synapse-847b9dcd1c9d7d7a43333e85f69dc78471095475.tar.xz |
Make max_delta equal to period * 10%
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/_base.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index 40802fd3dc..7f944ec717 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -329,14 +329,13 @@ class SQLBaseStore(object): user_id (str): User ID to set an expiration date for. use_delta (bool): If set to False, the expiration date for the user will be now + validity period. If set to True, this expiration date will be a - random value in the [now + period; now + period + max_delta] range, - max_delta being the configured value for the size of the range, unless - delta is 0, in which case it sets it to now + period. + random value in the [now + period; now + period + d] range, d being a + delta equal to 10% of the validity period. """ now_ms = self._clock.time_msec() expiration_ts = now_ms + self._account_validity.period - if use_delta and self._account_validity.startup_job_max_delta: + if use_delta: expiration_ts = self.rand.randrange( expiration_ts, expiration_ts + self._account_validity.startup_job_max_delta, |