Skip to content

Add watch mode with scheduled polling for automatic re-ingestion#24

Open
alecgard wants to merge 1 commit intomainfrom
feat/watch-polling
Open

Add watch mode with scheduled polling for automatic re-ingestion#24
alecgard wants to merge 1 commit intomainfrom
feat/watch-polling

Conversation

@alecgard
Copy link
Copy Markdown
Owner

Summary

Closes #6.

Adds kb ingest --watch --interval 1h — periodic re-ingestion of all registered sources on a loop. Replaces the previous fsnotify-based file watcher with a simpler polling approach that works for all connector types.

Usage

# Watch with default 1h interval
kb ingest --source ./my-repo --watch

# Custom interval
kb ingest --git https://github.com/acme/platform --watch --interval 30m

Changes

  • internal/ingest/watch.go — Rewritten: polling loop with configurable interval, clean shutdown
  • internal/ingest/watch_test.go — 3 new tests (callback, cancellation, error recovery)
  • cmd/kb/cmd_ingest.go — Added --interval flag, updated watch mode integration
  • Removed fsnotify dependency

Test plan

  • make test — all pass
  • Manual: kb ingest --source . --watch --interval 10s, verify re-ingestion fires

🤖 Generated with Claude Code

#6)

kb ingest --watch --interval 1h re-ingests all registered sources
on a loop. Replaces the previous fsnotify-based file watcher with
a simpler polling approach that works for all connector types.

- Configurable interval (default 1h)
- Logs results each cycle, continues on error
- Clean shutdown on SIGINT/SIGTERM
- Removed fsnotify dependency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alecgard alecgard force-pushed the feat/watch-polling branch from 0917c05 to 455e4f4 Compare March 17, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watch mode: automatic re-ingestion on source changes or schedule

1 participant