diff --git a/cmd/bd/compact.go b/cmd/bd/compact.go index 100a4497..cbbf07fc 100644 --- a/cmd/bd/compact.go +++ b/cmd/bd/compact.go @@ -183,6 +183,9 @@ func runCompactSingle(ctx context.Context, compactor *compact.Compactor, store * originalSize, compactedSize, savingBytes, float64(savingBytes)/float64(originalSize)*100) fmt.Printf(" Time: %v\n", elapsed) + + // Schedule auto-flush to export changes + markDirtyAndScheduleFlush() } func runCompactAll(ctx context.Context, compactor *compact.Compactor, store *sqlite.SQLiteStorage) { @@ -304,6 +307,11 @@ func runCompactAll(ctx context.Context, compactor *compact.Compactor, store *sql if totalOriginal > 0 { fmt.Printf(" Saved: %d bytes (%.1f%%)\n", totalSaved, float64(totalSaved)/float64(totalOriginal)*100) } + + // Schedule auto-flush to export changes + if successCount > 0 { + markDirtyAndScheduleFlush() + } } func runCompactStats(ctx context.Context, store *sqlite.SQLiteStorage) { diff --git a/cmd/bd/rename_prefix.go b/cmd/bd/rename_prefix.go index c7466042..6fdb9621 100644 --- a/cmd/bd/rename_prefix.go +++ b/cmd/bd/rename_prefix.go @@ -96,6 +96,9 @@ Example: os.Exit(1) } + // Schedule auto-flush to export changes + markDirtyAndScheduleFlush() + fmt.Printf("%s Successfully renamed prefix from %s to %s\n", green("✓"), cyan(oldPrefix), cyan(newPrefix)) if jsonOutput { diff --git a/cmd/bd/renumber.go b/cmd/bd/renumber.go index 08773ffa..b6ef49d3 100644 --- a/cmd/bd/renumber.go +++ b/cmd/bd/renumber.go @@ -127,6 +127,9 @@ Risks: os.Exit(1) } + // Schedule auto-flush to export changes + markDirtyAndScheduleFlush() + fmt.Printf("%s Successfully renumbered %d issues\n", green("✓"), len(issues)) // Count actual changes