1
0

Merge commit '923c99502' into anoa/dinsic_release_1_18_x

* commit '923c99502':
  Skip serializing /sync response if client has disconnected (#7927)
This commit is contained in:
Andrew Morgan
2020-08-03 17:39:15 -07:00
2 changed files with 7 additions and 0 deletions

1
changelog.d/7927.misc Normal file
View File

@@ -0,0 +1 @@
Optimisation to /sync handling: skip serializing the response if the client has already disconnected.

View File

@@ -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