MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / server_disconnect

Function server_disconnect

web/pgadmin/tools/psql/__init__.py:564–580  ·  view source on GitHub ↗

Disconnect the socket and terminate the process after user disconnect the server. we can't use disconnect event name as it is reserved for socket internal use.

(data)

Source from the content-addressed store, hash-verified

562
563@sio.on('server-disconnect', namespace='/pty')
564def server_disconnect(data):
565 """
566 Disconnect the socket and terminate the process after user disconnect
567 the server. we can't use disconnect event name as it is reserved for socket
568 internal use.
569 """
570 # request.sid: refer request.sid as socket id.
571 if request.sid in pdata and request.sid in app.config['sid_soid_mapping'][
572 data['sid']]:
573 # On disconnect socket manually exit the psql terminal and close the
574 # parend and child fd then kill the subprocess.
575 app.config['sid_soid_mapping'][data['sid']] = [soid for soid in
576 app.config[
577 'sid_soid_mapping'][
578 data['sid']] if
579 soid != request.sid]
580 disconnect_socket()
581
582
583def cleanup_globals():

Callers

nothing calls this directly

Calls 1

disconnect_socketFunction · 0.85

Tested by

no test coverage detected