From 3f49993f6b3db3278010fc2570331027510465d7 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sat, 12 Apr 2025 00:11:13 +0300 Subject: [PATCH] Update idle detection threshold to 4 hours --- checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checker.py b/checker.py index 3d815c1..9393737 100644 --- a/checker.py +++ b/checker.py @@ -341,13 +341,13 @@ if __name__ == "__main__": if result["current_status_type"] == "Idle": # Check type, not message uptime_seconds = os.popen("cat /proc/uptime | cut -d'.' -f1").read() uptime_seconds = int(uptime_seconds) - if uptime_seconds > 60*60*1: + if uptime_seconds > 60*60*4: reboot_count = int(current_vm.Reboots or 0) reboot_count += 1 # Include reboot count in the final Grist update before rebooting grist_updates = { "Health": "Rebooting", "Reboots": reboot_count } grist_callback(grist_updates) - logger.info(f"Idle detected for >1 hour (uptime: {uptime_seconds}s). Rebooting. Reboot count: {reboot_count}") + logger.info(f"Idle detected for >4 hours (uptime: {uptime_seconds}s). Rebooting. Reboot count: {reboot_count}") os.system("reboot") break # Exit loop on success except Exception as e: