feat: 综合平台services多服务支持+SW网络优先缓存修复+适配层/定时任务完善

This commit is contained in:
gouki
2026-08-05 11:57:17 +00:00
parent 7f1268f508
commit 1b7d4823c3
47 changed files with 2895 additions and 1189 deletions
+10 -4
View File
@@ -34,15 +34,21 @@ def collect_metrics() -> dict:
def _get_ip() -> str:
"""获取本机出口 IP(不实际发包)"""
"""获取本机出口 IPUDP 不实际发包;设超时避免无网环境阻塞"""
s = None
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.settimeout(2) # 无网络环境下 connect 可能阻塞,加超时保护
s.connect(("8.8.8.8", 80))
ip = s.getsockname()[0]
s.close()
return ip
return s.getsockname()[0]
except Exception:
return ""
finally:
if s is not None:
try:
s.close()
except Exception:
pass
def collect_server_info() -> dict: