@@ -80,6 +80,12 @@ async def process_node_health_check(db_node: Node, node: PasarGuardNode):
8080 if node is None :
8181 return
8282
83+ # Handle hard reset requirement
84+ if node .requires_hard_reset ():
85+ async with GetDB () as db :
86+ await node_operator .connect_single_node (db , db_node .id )
87+ return
88+
8389 try :
8490 health , error_code , error_message = await verify_node_backend_health (node , db_node .name )
8591 except asyncio .TimeoutError :
@@ -107,12 +113,6 @@ async def process_node_health_check(db_node: Node, node: PasarGuardNode):
107113 if health == Health .HEALTHY and db_node .status == NodeStatus .connected :
108114 return
109115
110- # Handle hard reset requirement
111- if node .requires_hard_reset ():
112- async with GetDB () as db :
113- await node_operator .connect_single_node (db , db_node .id )
114- return
115-
116116 if health is Health .INVALID :
117117 logger .warning (f"[{ db_node .name } ] Node health is INVALID, ignoring..." )
118118 return
@@ -138,6 +138,7 @@ async def process_node_health_check(db_node: Node, node: PasarGuardNode):
138138 # Update status for recovering nodes
139139 if db_node .status in (NodeStatus .connecting , NodeStatus .error ) and health == Health .HEALTHY :
140140 async with GetDB () as db :
141+ logger .info (f"Node '{ db_node .name } ' have been recovered" )
141142 node_version , core_version = await node .get_versions ()
142143 await NodeOperation ._update_single_node_status (
143144 db ,
0 commit comments