Skip to content

Commit

Permalink
Fix: ToolserverManager node checker
Browse files Browse the repository at this point in the history
  • Loading branch information
luyaxi committed Nov 26, 2023
1 parent 4463217 commit cea1180
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ToolServer/ToolServerManager/node_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,19 @@ async def check_nodes_status():
if node_status == "running":
if datetime.datetime.utcnow() - node.last_req_time >= datetime.timedelta(minutes=CONFIG['node']['idling_close_minutes']):
container.stop()
logger.info("Stopping node: " + node['node_id'] + " due to idling time used up")
logger.info("Stopping node: " + node.id + " due to idling time used up")


async def check_nodes_status_loop():
"""
An infinite loop that checks the status of the nodes and waits 1 second before each iteration.
"""
while True:
await check_nodes_status()
try:
await check_nodes_status()
except:
import traceback
traceback.print_exc()
await asyncio.sleep(CONFIG['node'].get('health_check_interval',1))


Expand Down

0 comments on commit cea1180

Please sign in to comment.