From 7e5b382161df59b81f8617ec35e0378deec35dc0 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 2 Nov 2025 15:50:35 -0800 Subject: [PATCH] Only flush JSONL on import if there were actual changes Avoid unnecessary I/O when import has no updates --- cmd/bd/import.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/bd/import.go b/cmd/bd/import.go index f5dfbdaf..c67478ec 100644 --- a/cmd/bd/import.go +++ b/cmd/bd/import.go @@ -178,7 +178,10 @@ Behavior: // Flush immediately after import (no debounce) to ensure daemon sees changes // Without this, daemon FileWatcher won't detect the import for up to 30s - flushToJSONL() + // Only flush if there were actual changes to avoid unnecessary I/O + if result.Created > 0 || result.Updated > 0 || len(result.IDMapping) > 0 { + flushToJSONL() + } // Print summary fmt.Fprintf(os.Stderr, "Import complete: %d created, %d updated", result.Created, result.Updated)