Skip to main content

Module daemon

Module daemon 

Source
Expand description

Multi-repo daemon with periodic indexing.

Replaces N codesearch serve processes (one per repo) with a single daemon that manages all repos from one process. Each repo keeps its own .codesearch.db (LMDB + tantivy + metadata) — the daemon opens all of them and searches across all stores, merging results by score.

§Configuration

The daemon reads a YAML config file (following the hanabi/kenshi/shinka pattern):

port: 4444
index_interval: 300
lmdb_map_size_mb: 2048
repos:
  - /path/to/repo1
  - /path/to/repo2

Load order: defaults → YAML file → env vars

Modules§

github
GitHub auto-discovery: list repos from orgs/users, clone missing ones.
server
Multi-repo HTTP server for the daemon.

Structs§

DaemonConfig
Daemon configuration loaded from YAML.
DaemonState
Shared daemon state accessible from HTTP handlers and the reindex task.
GitHubConfig
GitHub auto-discovery: resolve repos from GitHub orgs/users.
GitHubSource
A single GitHub owner (org or user) to discover repos from.
RepoHandle
Per-repo handle holding its stores and metadata.

Enums§

OwnerKind
Whether a GitHub source is an organization or user.

Functions§

run_daemon
Main daemon entry point.