mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-25 19:15:51 +03:00
Always cache 'event_to_prev_state_group' (#9950)
Fixes regression in send PDU times introduced in #9905.
This commit is contained in:
parent
765473567c
commit
6c84778549
2 changed files with 8 additions and 6 deletions
1
changelog.d/9950.feature
Normal file
1
changelog.d/9950.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Improve performance of sending events for worker-based deployments using Redis.
|
|
@ -1050,6 +1050,13 @@ class EventCreationHandler:
|
|||
)
|
||||
|
||||
if state_entry.state_group:
|
||||
await self._external_cache.set(
|
||||
"event_to_prev_state_group",
|
||||
event.event_id,
|
||||
state_entry.state_group,
|
||||
expiry_ms=60 * 60 * 1000,
|
||||
)
|
||||
|
||||
if state_entry.state_group in self._external_cache_joined_hosts_updates:
|
||||
return
|
||||
|
||||
|
@ -1057,12 +1064,6 @@ class EventCreationHandler:
|
|||
|
||||
# Note that the expiry times must be larger than the expiry time in
|
||||
# _external_cache_joined_hosts_updates.
|
||||
await self._external_cache.set(
|
||||
"event_to_prev_state_group",
|
||||
event.event_id,
|
||||
state_entry.state_group,
|
||||
expiry_ms=60 * 60 * 1000,
|
||||
)
|
||||
await self._external_cache.set(
|
||||
"get_joined_hosts",
|
||||
str(state_entry.state_group),
|
||||
|
|
Loading…
Reference in a new issue