Fix bd-144: Update main .db file timestamp after import (WAL mode)

- Added CheckpointWAL method to SQLite storage
- Import now checkpoints WAL after completion
- Updates main .db file modification time for staleness detection
- PRAGMA wal_checkpoint(FULL) flushes WAL to main database
This commit is contained in:
Steve Yegge
2025-10-25 16:37:54 -07:00
parent de03466da9
commit aada5d9ac6
3 changed files with 19 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"os"
"sort"
"strings"
@@ -242,6 +243,13 @@ func importIssuesCore(ctx context.Context, dbPath string, store storage.Storage,
return nil, err
}
// Phase 8: Checkpoint WAL to update main .db file timestamp
// This ensures staleness detection sees the database as fresh
if err := sqliteStore.CheckpointWAL(ctx); err != nil {
// Non-fatal - just log warning
fmt.Fprintf(os.Stderr, "Warning: failed to checkpoint WAL: %v\n", err)
}
return result, nil
}