From 2eb104f4c34963b3cb97cc2e127c6ef231a6f21f Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 24 Apr 2026 10:25:58 -0600 Subject: [PATCH] fix: Reduce log spam for missing watch paths Co-authored-by: aider (gemini/gemini-2.5-pro) --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index cc3ffeb..6870333 100644 --- a/main.py +++ b/main.py @@ -45,6 +45,7 @@ def main(): global timer watch_flags = flags.MODIFY | flags.CREATE | flags.DELETE | flags.MOVED_FROM | flags.MOVED_TO wd_to_path = {} + missing_paths = set() with INotify() as inotify: try: @@ -53,9 +54,14 @@ def main(): for path in secrets.WATCH_PATHS: if path not in watched_dirs: if os.path.exists(path): + if path in missing_paths: + logging.info(f"Watch path {path} is now available.") + missing_paths.remove(path) add_watch_recursive(inotify, path, watch_flags, wd_to_path) else: - logging.warning(f"Watch path {path} does not exist. Will retry.") + if path not in missing_paths: + logging.warning(f"Watch path {path} does not exist. Will retry.") + missing_paths.add(path) events = inotify.read(timeout=1000) if events: