(conn)
| 281 | logging.info(f"Accepted connection from {addr}") |
| 282 | while True: |
| 283 | data = conn.recv(1024).decode() |
| 284 | if not data: |
| 285 | break |
| 286 | handle_message(conn, data, addr) |
| 287 | logging.info(f"Connection from {addr} closed") |
| 288 | conn.close() |
| 289 | |
| 290 | def schedule_update(): |
| 291 | update_gpu_info() |
| 292 | threading.Timer(240, schedule_update).start() # 600秒 = 10分钟 |
| 293 | |
| 294 | def main(): |
| 295 | #一开始先初始化redis里的服务器信息,然后启动TCP连接,监听Server请求 |
nothing calls this directly
no test coverage detected