fix: Reduce log spam for missing watch paths
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
8
main.py
8
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:
|
||||
|
||||
Reference in New Issue
Block a user