pub fn start_eviction_loop(
store: Arc<SqliteStore>,
config: &EvictionConfig,
policy: Arc<dyn EvictionPolicy + 'static>,
cancel: CancellationToken,
) -> JoinHandle<()>Expand description
Start the background eviction loop.
The loop runs every config.sweep_interval_secs seconds. Each iteration:
- Queries
SQLitefor all non-deleted entries and their eviction metadata. - Scores each entry using
policy. - If the count exceeds
config.max_entries, soft-deletes the excess lowest-scoring rows. - Queries for all soft-deleted rows and attempts to remove their Qdrant vectors. If Qdrant removal fails, it is retried on the next sweep cycle.
If config.max_entries == 0, the loop exits immediately without doing anything.
ยงErrors (non-fatal)
Database and Qdrant errors are logged but do not stop the loop.