Skip to content
Snippets Groups Projects
Unverified Commit 923c9950 authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Skip serializing /sync response if client has disconnected (#7927)

... it's a load of work which may be entirely redundant.
parent b74919c7
No related branches found
No related tags found
No related merge requests found
Optimisation to /sync handling: skip serializing the response if the client has already disconnected.
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment