diff --git a/web/pgadmin/tools/psql/__init__.py b/web/pgadmin/tools/psql/__init__.py index 6d7008922..85acafb20 100644 --- a/web/pgadmin/tools/psql/__init__.py +++ b/web/pgadmin/tools/psql/__init__.py @@ -235,7 +235,7 @@ def read_stdout(process, sid, max_read_bytes, win_emit_output=True): 'error': False}, namespace='/pty', room=sid) - sio.sleep(0) + sio.sleep(0.01) def windows_platform(connection_data, sid, max_read_bytes, server_id): @@ -246,10 +246,11 @@ def windows_platform(connection_data, sid, max_read_bytes, server_id): process.write("\r\n") app.config['sessions'][request.sid] = process pdata[request.sid] = process + cdata[request.sid] = process.fd open_psql_connections[request.sid] = server_id set_term_size(process, 50, 50) - while True: + while process.isalive(): read_stdout(process, sid, max_read_bytes, win_emit_output=True)