Fixed an issue where CPU usage was very high on Windows when opening the psql tool. #8864

pull/9017/head
Pravesh Sharma 2025-08-01 12:41:16 +05:30 committed by GitHub
parent 559c6cfa65
commit 829d6323b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

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