enhance health check
This commit is contained in:
parent
20a4e9cfd4
commit
e1af79bac9
@ -282,7 +282,7 @@ if __name__ == "__main__":
|
|||||||
#time.sleep(random_sleep)
|
#time.sleep(random_sleep)
|
||||||
|
|
||||||
grist_data = {}
|
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_data = json.loads(f.read())
|
||||||
|
|
||||||
GRIST_ROW_NAME = socket.gethostname()
|
GRIST_ROW_NAME = socket.gethostname()
|
||||||
@ -295,8 +295,10 @@ if __name__ == "__main__":
|
|||||||
try:
|
try:
|
||||||
result = check_logs(logger)
|
result = check_logs(logger)
|
||||||
grist_callback({ "Health": result["status"] })
|
grist_callback({ "Health": result["status"] })
|
||||||
logger.info(f"Status: {result['status']}")
|
logger.info(f"Status: {result['status']} ()")
|
||||||
break
|
if result["status"] == "Idle":
|
||||||
|
grist_callback({ "Health": "Rebooting" })
|
||||||
|
os.system("reboot")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error on attempt {attempt+1}/3: {e}")
|
logger.error(f"Error on attempt {attempt+1}/3: {e}")
|
||||||
if attempt == 2:
|
if attempt == 2:
|
||||||
|
27
ritual.code-workspace
Normal file
27
ritual.code-workspace
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../ritual-git"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"workbench.colorCustomizations": {
|
||||||
|
"activityBar.activeBackground": "#fb94f8",
|
||||||
|
"activityBar.background": "#fb94f8",
|
||||||
|
"activityBar.foreground": "#15202b",
|
||||||
|
"activityBar.inactiveForeground": "#15202b99",
|
||||||
|
"activityBarBadge.background": "#777b05",
|
||||||
|
"activityBarBadge.foreground": "#e7e7e7",
|
||||||
|
"commandCenter.border": "#15202b99",
|
||||||
|
"sash.hoverBorder": "#fb94f8",
|
||||||
|
"titleBar.activeBackground": "#f963f5",
|
||||||
|
"titleBar.activeForeground": "#15202b",
|
||||||
|
"titleBar.inactiveBackground": "#f963f599",
|
||||||
|
"titleBar.inactiveForeground": "#15202b99"
|
||||||
|
},
|
||||||
|
"peacock.color": "#f963f5"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user