Skip to main content

run_watch_daemon

Function run_watch_daemon 

Source
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:

  1. Listens for file system events via the async watcher
  2. Debounces rapid changes (batches events within a time window)
  3. Triggers incremental index updates for changed files
  4. Removes deleted files from the index

The index is shared with the HTTP server via Arc<RwLock<>>.