mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 06:03:42 -05:00
[Router] gracefully set and do not reset the ol_context
This commit is contained in:
parent
ce4f9148c3
commit
d17ef183d0
1 changed files with 2 additions and 6 deletions
|
@ -55,7 +55,7 @@ module.exports = Router =
|
|||
app.post "/client/:client_id/disconnect", httpAuth, HttpApiController.disconnectClient
|
||||
|
||||
session.on 'connection', (error, client, session) ->
|
||||
client.ol_context = {}
|
||||
client.ol_context = {} unless client.ol_context
|
||||
|
||||
client?.on "error", (err) ->
|
||||
logger.err { clientErr: err }, "socket.io client error"
|
||||
|
@ -113,13 +113,9 @@ module.exports = Router =
|
|||
metrics.inc('socket-io.disconnect')
|
||||
metrics.gauge('socket-io.clients', io.sockets.clients()?.length - 1)
|
||||
|
||||
cleanup = () ->
|
||||
delete client.ol_context
|
||||
WebsocketController.leaveProject io, client, (err) ->
|
||||
if err?
|
||||
Router._handleError cleanup, err, client, "leaveProject"
|
||||
else
|
||||
cleanup()
|
||||
Router._handleError (() ->), err, client, "leaveProject"
|
||||
|
||||
# Variadic. The possible arguments:
|
||||
# doc_id, callback
|
||||
|
|
Loading…
Reference in a new issue