fix: harden deepseek official remote43 import closure

This commit is contained in:
phamnazage-jpg
2026-05-27 07:56:24 +08:00
parent bcfc08568c
commit c1172d7714
12 changed files with 172 additions and 29 deletions

View File

@@ -44,6 +44,11 @@ func Open(ctx context.Context, dsn string) (*DB, error) {
if err != nil {
return nil, fmt.Errorf("open sqlite database: %w", err)
}
// SQLite only tolerates a single writer at a time. Pin the pool to one
// connection so HTTP flows that chain several writes (for example host
// probe refresh + import persistence) do not self-deadlock into SQLITE_BUSY.
sqlDB.SetMaxOpenConns(1)
sqlDB.SetMaxIdleConns(1)
if err := sqlDB.PingContext(ctx); err != nil {
_ = sqlDB.Close()