summary refs log tree commit diff
path: root/synapse/groups
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-11-07 13:31:03 +0000
committerErik Johnston <erik@matrix.org>2017-11-07 13:31:03 +0000
commitf9b255cd62fe724e16b2222f6af623b2d39282ab (patch)
treeb22288443c2edfa647f6a0ac5980066014b20a1f /synapse/groups
parentMerge pull request #2647 from matrix-org/luke/get-group-users-is-privileged (diff)
parentMerge pull request #2598 from matrix-org/revert-2596-erikj/attestation_jitter (diff)
downloadsynapse-f9b255cd62fe724e16b2222f6af623b2d39282ab.tar.xz
Merge branch 'master' of github.com:matrix-org/synapse into develop
Diffstat (limited to 'synapse/groups')
-rw-r--r--synapse/groups/attestations.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/synapse/groups/attestations.py b/synapse/groups/attestations.py
index 1fb709e6c3..784af9cbcf 100644
--- a/synapse/groups/attestations.py
+++ b/synapse/groups/attestations.py
@@ -53,11 +53,6 @@ logger = logging.getLogger(__name__)
 # Default validity duration for new attestations we create
 DEFAULT_ATTESTATION_LENGTH_MS = 3 * 24 * 60 * 60 * 1000
 
-# We add some jitter to the validity duration of attestations so that if we
-# add lots of users at once we don't need to renew them all at once.
-# The jitter is a multiplier picked randomly between the first and second number
-DEFAULT_ATTESTATION_JITTER = (0.9, 1.3)
-
 # Start trying to update our attestations when they come this close to expiring
 UPDATE_ATTESTATION_TIME_MS = 1 * 24 * 60 * 60 * 1000
 
@@ -106,14 +101,10 @@ class GroupAttestationSigning(object):
         """Create an attestation for the group_id and user_id with default
         validity length.
         """
-        validity_period = DEFAULT_ATTESTATION_LENGTH_MS
-        validity_period *= random.uniform(*DEFAULT_ATTESTATION_JITTER)
-        valid_until_ms = int(self.clock.time_msec() + validity_period)
-
         return sign_json({
             "group_id": group_id,
             "user_id": user_id,
-            "valid_until_ms": valid_until_ms,
+            "valid_until_ms": self.clock.time_msec() + DEFAULT_ATTESTATION_LENGTH_MS,
         }, self.server_name, self.signing_key)