mirror of
https://github.com/deepmodeling/Uni-Lab-OS
synced 2026-05-23 00:49:53 +00:00
improve: 使用调度状态接口做健康检查
- 将 Bioyond 启动健康检查从物料类型列表切换为 scheduler_status()。 - 避免 debug 日志输出完整物料类型列表。 - 保持连接监控响应更轻量、更易读。
This commit is contained in:
@@ -56,13 +56,17 @@ class ConnectionMonitor:
|
||||
def _monitor_loop(self):
|
||||
while self._running:
|
||||
try:
|
||||
# 使用 lightweight API 检查连接
|
||||
# query_matial_type_list 是比较快的查询
|
||||
start_time = time.time()
|
||||
result = self.workstation.hardware_interface.material_type_list()
|
||||
# 使用轻量级调度状态接口检查连接,避免启动时打印完整物料类型列表。
|
||||
result = self.workstation.hardware_interface.scheduler_status()
|
||||
|
||||
status = "online" if result else "offline"
|
||||
msg = "Connection established" if status == "online" else "Failed to get material type list"
|
||||
if status == "online":
|
||||
msg = (
|
||||
f"Scheduler status={result.get('status')}, "
|
||||
f"hasTask={result.get('hasTask')}"
|
||||
)
|
||||
else:
|
||||
msg = "Failed to get scheduler status"
|
||||
|
||||
if status != self._last_status:
|
||||
logger.info(f"Bioyond连接状态变更: {self._last_status} -> {status}")
|
||||
|
||||
Reference in New Issue
Block a user