mirror of
https://github.com/element-hq/synapse
synced 2024-10-01 22:42:41 +00:00
Avoid serializing response that will never be heard
This commit is contained in:
parent
1268a5413f
commit
e4c66b8ac9
1 changed files with 6 additions and 0 deletions
|
@ -914,6 +914,12 @@ class SlidingSyncRestServlet(RestServlet):
|
||||||
timeout,
|
timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 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, {}
|
||||||
|
|
||||||
response_content = await self.encode_response(sliding_sync_results)
|
response_content = await self.encode_response(sliding_sync_results)
|
||||||
|
|
||||||
return 200, response_content
|
return 200, response_content
|
||||||
|
|
Loading…
Reference in a new issue