From a193dbacd7b6921c99eec9b5f1855df2b414aaef Mon Sep 17 00:00:00 2001 From: Shane Date: Thu, 15 May 2025 19:18:27 +1000 Subject: [PATCH] try --- foodie_utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/foodie_utils.py b/foodie_utils.py index 7a9f502..822477e 100644 --- a/foodie_utils.py +++ b/foodie_utils.py @@ -1689,16 +1689,20 @@ def is_any_script_running(): activity_file = "/home/shane/foodie_automator/system_activity.json" try: activities = load_json_file(activity_file, default=[]) + logging.debug(f"[DEBUG] system_activity.json contents: {activities}") for entry in activities: + logging.debug(f"[DEBUG] Checking entry: {entry}") if entry.get("status") == "running" and entry.get("pid"): try: - # Verify the process is still running import psutil process = psutil.Process(entry["pid"]) if process.is_running(): + logging.debug(f"[DEBUG] Found running process: {entry['pid']}") return True - except Exception: + except Exception as e: + logging.debug(f"[DEBUG] Exception checking process: {e}") continue + logging.debug("[DEBUG] No running scripts found.") return False except Exception as e: logging.error(f"Failed to check system_activity.json: {e}")