diff --git a/crates/codegraph/src/main.rs b/crates/codegraph/src/main.rs index e0a4c17e2..d72d57073 100644 --- a/crates/codegraph/src/main.rs +++ b/crates/codegraph/src/main.rs @@ -602,10 +602,6 @@ async fn cmd_serve( } else { allowed_hosts.extend(allow_host); } - let use_root = !is_fs_root(root); - if use_root && is_initialized(root) { - watcher::spawn(root.to_path_buf(), storage_dsn(root)); - } return codegraph_mcp::serve_http( format, mermaid, @@ -630,10 +626,7 @@ async fn cmd_serve( // session and let the agent bind the project path through the tool. let use_root = !is_fs_root(root); let initialized = use_root && is_initialized(root); - let dsn = if initialized { storage_dsn(root) } else { None }; - if initialized { - watcher::spawn(root.to_path_buf(), dsn.clone()); - } + let _dsn = if initialized { storage_dsn(root) } else { None }; let server = if use_root { CodegraphServer::with_root_and_format(root.to_path_buf(), format, mermaid).await? } else { diff --git a/crates/codegraph/src/watcher.rs b/crates/codegraph/src/watcher.rs index 30af8a8fb..c9b489941 100644 --- a/crates/codegraph/src/watcher.rs +++ b/crates/codegraph/src/watcher.rs @@ -11,14 +11,6 @@ use std::time::Duration; /// Spawn a debounced watcher that full re-indexes the workspace on file changes. /// Runs on a background tokio task; cancellation when the runtime drops. /// `dsn = None` (in-memory backend) → không có file ngoài để theo dõi, bỏ qua. -pub fn spawn(root: Utf8PathBuf, dsn: Option) { - let Some(dsn) = dsn else { return }; - tokio::task::spawn_blocking(move || { - if let Err(e) = run(root, dsn) { - tracing::error!("watcher error: {e}"); - } - }); -} fn run(root: Utf8PathBuf, dsn: String) -> Result<()> { let (tx, rx) = std::sync::mpsc::channel::>();