mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 00:24:56 -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
|
@ -52,6 +52,7 @@ from twisted.internet.interfaces import (
|
|||
)
|
||||
|
||||
from synapse.api.errors import Codes, SynapseError
|
||||
from synapse.util.cancellation import cancellable
|
||||
from synapse.util.stringutils import parse_and_validate_server_name
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -699,7 +700,11 @@ class StreamToken:
|
|||
START: ClassVar["StreamToken"]
|
||||
|
||||
@classmethod
|
||||
@cancellable
|
||||
async def from_string(cls, store: "DataStore", string: str) -> "StreamToken":
|
||||
"""
|
||||
Creates a RoomStreamToken from its textual representation.
|
||||
"""
|
||||
try:
|
||||
keys = string.split(cls._SEPARATOR)
|
||||
while len(keys) < len(attr.fields(cls)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue