From 0c340e1eb6554fef85bf5c43777ae1a3d61a22f5 Mon Sep 17 00:00:00 2001 From: you Date: Sat, 4 Apr 2026 07:46:25 +0000 Subject: [PATCH] fix: set hasResolvedPath flag after ensuring column exists detectSchema() runs at DB open time before ensureResolvedPathColumn() adds the column during Load(). On first run (or any run where the column was just added), hasResolvedPath stayed false, causing Load() to skip reading resolved_path from SQLite. This forced a full backfill of all observations on every restart, burning CPU for minutes on large DBs. Fix: set hasResolvedPath = true after ensureResolvedPathColumn succeeds. --- cmd/server/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/server/main.go b/cmd/server/main.go index 0aac9c73..3b30709d 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -157,6 +157,8 @@ func main() { // AND to SQLite. On next restart, detectSchema finds the column and Load() reads it. if err := ensureResolvedPathColumn(dbPath); err != nil { log.Printf("[store] warning: could not add resolved_path column: %v", err) + } else { + database.hasResolvedPath = true // detectSchema ran before column was added; fix the flag } // Load or build neighbor graph