pub async fn run_watch_daemon(
watch_path: &Path,
config: &SeekrConfig,
index: Arc<RwLock<SeekrIndex>>,
debounce_ms: Option<u64>,
) -> Result<(), ServerError>Expand description
Run the watch daemon that monitors file changes and updates the index.
This function spawns an async task that:
- Listens for file system events via the async watcher
- Debounces rapid changes (batches events within a time window)
- Triggers incremental index updates for changed files
- Removes deleted files from the index
The index is shared with the HTTP server via Arc<RwLock<>>.