MCPcopy
hub / github.com/tirth8205/code-review-graph / start_watch_thread

Function start_watch_thread

code_review_graph/incremental.py:1211–1234  ·  view source on GitHub ↗

Start watch mode in a background thread. Returns the started thread, or None if watchdog is unavailable.

(
    repo_root: Path,
    store: GraphStore,
    daemon: bool = True,
)

Source from the content-addressed store, hash-verified

1209
1210
1211def start_watch_thread(
1212 repo_root: Path,
1213 store: GraphStore,
1214 daemon: bool = True,
1215) -> threading.Thread | None:
1216 """Start watch mode in a background thread.
1217
1218 Returns the started thread, or None if watchdog is unavailable.
1219 """
1220 try:
1221 import watchdog # noqa: F401
1222 except ImportError:
1223 logger.warning("watchdog not installed; auto-watch disabled")
1224 return None
1225
1226 thread = threading.Thread(
1227 target=watch,
1228 args=(repo_root, store),
1229 daemon=daemon,
1230 name="crg-watch",
1231 )
1232 thread.start()
1233 logger.info("Auto-watch started for %s", repo_root)
1234 return thread

Callers 3

mainFunction · 0.85

Calls 1

startMethod · 0.45