enhance health check
This commit is contained in:
@ -282,7 +282,7 @@ if __name__ == "__main__":
|
||||
#time.sleep(random_sleep)
|
||||
|
||||
grist_data = {}
|
||||
with open('/root/node/grist.json', 'r', encoding='utf-8') as f:
|
||||
with open('/root/node/grist_1.json', 'r', encoding='utf-8') as f:
|
||||
grist_data = json.loads(f.read())
|
||||
|
||||
GRIST_ROW_NAME = socket.gethostname()
|
||||
@ -295,8 +295,10 @@ if __name__ == "__main__":
|
||||
try:
|
||||
result = check_logs(logger)
|
||||
grist_callback({ "Health": result["status"] })
|
||||
logger.info(f"Status: {result['status']}")
|
||||
break
|
||||
logger.info(f"Status: {result['status']} ()")
|
||||
if result["status"] == "Idle":
|
||||
grist_callback({ "Health": "Rebooting" })
|
||||
os.system("reboot")
|
||||
except Exception as e:
|
||||
logger.error(f"Error on attempt {attempt+1}/3: {e}")
|
||||
if attempt == 2:
|
||||
|
||||
Reference in New Issue
Block a user