Merge pull request #3065 from chengzhichao-xydt/codex/short-engine-close-errors

fix(seahorse): explicitly ignore Close() errors on PRAGMA/migration failure paths
This commit is contained in:
Mauro authored and GitHub committed 2026-06-13 18:19:35 +02:00
commit cf67dd3851
1 file changed
+4 -4
+4 -4
View File
@@ -113,20 +113,20 @@ func NewEngine(config Config, completeFn CompleteFn) (*Engine, error) {
// Configure SQLite for concurrent access
if _, err := db.Exec("PRAGMA journal_mode = WAL;"); err != nil {
db.Close()
_ = db.Close()
return nil, fmt.Errorf("enable WAL: %w", err)
}
if _, err := db.Exec("PRAGMA busy_timeout = 5000;"); err != nil {
db.Close()
_ = db.Close()
return nil, fmt.Errorf("set busy_timeout: %w", err)
}
if _, err := db.Exec("PRAGMA synchronous = NORMAL;"); err != nil {
db.Close()
_ = db.Close()
return nil, fmt.Errorf("set synchronous: %w", err)
}
if err := runSchema(db); err != nil {
db.Close()
_ = db.Close()
return nil, fmt.Errorf("migrations: %w", err)
}