Skip to content

Commit 185555b

Browse files
anoadragon453phil-flex
authored andcommitted
Port group attestation renewal slow down from matrix-org-hotfixes (matrix-org#7442)
1 parent c913268 commit 185555b

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

changelog.d/7442.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Run group attestation renewal in series rather than parallel for performance.

synapse/groups/attestations.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
from synapse.api.errors import HttpResponseException, RequestSendFailed, SynapseError
4747
from synapse.metrics.background_process_metrics import run_as_background_process
4848
from synapse.types import get_domain_from_id
49-
from synapse.util.async_helpers import yieldable_gather_results
5049

5150
logger = logging.getLogger(__name__)
5251

@@ -208,6 +207,5 @@ def _renew_attestation(group_user: Tuple[str, str]):
208207
"Error renewing attestation of %r in %r", user_id, group_id
209208
)
210209

211-
await yieldable_gather_results(
212-
_renew_attestation, ((row["group_id"], row["user_id"]) for row in rows)
213-
)
210+
for row in rows:
211+
await _renew_attestation((row["group_id"], row["user_id"]))

0 commit comments

Comments
 (0)