mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 13:04:57 -04:00
More speedups/fixes to creating batched events (#15195)
This commit is contained in:
parent
20ed8c926b
commit
a368d30c1c
5 changed files with 33 additions and 9 deletions
|
@ -63,9 +63,18 @@ class EventAuthHandler:
|
|||
self._store, event, batched_auth_events
|
||||
)
|
||||
auth_event_ids = event.auth_event_ids()
|
||||
auth_events_by_id = await self._store.get_events(auth_event_ids)
|
||||
|
||||
if batched_auth_events:
|
||||
auth_events_by_id.update(batched_auth_events)
|
||||
# Copy the batched auth events to avoid mutating them.
|
||||
auth_events_by_id = dict(batched_auth_events)
|
||||
needed_auth_event_ids = set(auth_event_ids) - set(batched_auth_events)
|
||||
if needed_auth_event_ids:
|
||||
auth_events_by_id.update(
|
||||
await self._store.get_events(needed_auth_event_ids)
|
||||
)
|
||||
else:
|
||||
auth_events_by_id = await self._store.get_events(auth_event_ids)
|
||||
|
||||
check_state_dependent_auth_rules(event, auth_events_by_id.values())
|
||||
|
||||
def compute_auth_events(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue