mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 01:14:48 -04:00
Skip serializing /sync response if client has disconnected (#7927)
... it's a load of work which may be entirely redundant.
This commit is contained in:
parent
b74919c72e
commit
923c995023
2 changed files with 7 additions and 0 deletions
|
@ -178,6 +178,12 @@ class SyncRestServlet(RestServlet):
|
|||
full_state=full_state,
|
||||
)
|
||||
|
||||
# the client may have disconnected by now; don't bother to serialize the
|
||||
# response if so.
|
||||
if request._disconnected:
|
||||
logger.info("Client has disconnected; not serializing response.")
|
||||
return 200, {}
|
||||
|
||||
time_now = self.clock.time_msec()
|
||||
response_content = await self.encode_response(
|
||||
time_now, sync_result, requester.access_token_id, filter_collection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue