pull/1511/merge
undefined 2026-02-16 07:47:45 +00:00 committed by GitHub
commit ca8b374717
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -89,6 +89,8 @@ class WebUIServer:
try:
with socket.socket(family, socket.SOCK_STREAM) as s:
s.settimeout(1)
# 与 Uvicorn 一致:允许在 TIME_WAIT 状态下绑定,减少误报
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# 尝试绑定端口
s.bind((test_host, self.port))
return True