MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / wait_for_reboot

Method wait_for_reboot

mod/project/node/nodeutil/base.py:981–996  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

979 repo.set_wait_reboot(self.node_server_ip, True)
980
981 def wait_for_reboot():
982 # wait 等待服务器重启成功, 超时时间默认为 10 分钟
983 wait_for = time.time() + 600
984 time.sleep(3)
985 while time.time() < wait_for:
986 if self.test_conn() == "": # 无错误时表示重启成功
987 repo.set_wait_reboot(self.node_server_ip, False)
988 from mod.project.node.dbutil import ServerNodeDB
989 node_data = ServerNodeDB().find_node(api_key=self.api_key, app_key=self.app_key.to_string())
990 if node_data:
991 monitor_node_once(node_data)
992 return {"status": True, "msg": "重启服务器成功"}
993 time.sleep(3)
994 public.print_log("等待服务器重启中... {}".format(wait_for - time.time()))
995 repo.set_wait_reboot(self.node_server_ip, False)
996 return {"status": False, "msg": "重启服务器失败, 已超过10分钟未能检测到服务器信息"}
997
998 t = threading.Thread(target=wait_for_reboot, daemon=True)
999 t.start()

Callers

nothing calls this directly

Calls 9

test_connMethod · 0.95
ServerNodeDBClass · 0.90
monitor_node_onceFunction · 0.85
timeMethod · 0.80
set_wait_rebootMethod · 0.80
find_nodeMethod · 0.80
to_stringMethod · 0.45
print_logMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected