mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-08 21:42:39 -04:00
Cancel the processing of key query requests when they time out. (#13680)
This commit is contained in:
parent
c2fe48a6ff
commit
d3d9ca156e
18 changed files with 110 additions and 20 deletions
|
@ -81,6 +81,7 @@ from synapse.util import unwrapFirstError
|
|||
from synapse.util.async_helpers import ObservableDeferred, delay_cancellation
|
||||
from synapse.util.caches.descriptors import cached, cachedList
|
||||
from synapse.util.caches.lrucache import AsyncLruCache
|
||||
from synapse.util.cancellation import cancellable
|
||||
from synapse.util.iterutils import batch_iter
|
||||
from synapse.util.metrics import Measure
|
||||
|
||||
|
@ -339,6 +340,7 @@ class EventsWorkerStore(SQLBaseStore):
|
|||
) -> Optional[EventBase]:
|
||||
...
|
||||
|
||||
@cancellable
|
||||
async def get_event(
|
||||
self,
|
||||
event_id: str,
|
||||
|
@ -433,6 +435,7 @@ class EventsWorkerStore(SQLBaseStore):
|
|||
|
||||
@trace
|
||||
@tag_args
|
||||
@cancellable
|
||||
async def get_events_as_list(
|
||||
self,
|
||||
event_ids: Collection[str],
|
||||
|
@ -584,6 +587,7 @@ class EventsWorkerStore(SQLBaseStore):
|
|||
|
||||
return events
|
||||
|
||||
@cancellable
|
||||
async def _get_events_from_cache_or_db(
|
||||
self, event_ids: Iterable[str], allow_rejected: bool = False
|
||||
) -> Dict[str, EventCacheEntry]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue