+import logging
import threading
import time
from watchdog.events import DirDeletedEvent, FileDeletedEvent, FileSystemEventHandler
self._observer.schedule(self, path=dir_path, recursive=True)
def start(self):
- self._observer.start()
+ try:
+ self._observer.start()
+ except Exception as e:
+ logging.warning("Error starting file observer for %s: %s", dir_path, str(e))
def stop(self):
self._observer.stop()