The expression `str(path.stat().st_mtime_ns) if path.exists() else None` has a TOCTOU race: the file can be deleted between exists() and stat(). The resulting FileNotFoundError propagates up to _watch_loop's except handler, which records a breaker failure and terminates the loop — no more push events are processed until restart. Replace with a try/except around stat() and return early on FileNotFoundError. The deletion event from watchfiles will handle cleanup. |
||
|---|---|---|
| .. | ||
| rag | ||