Fix SQLite queue

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-05-19 15:05:46 +02:00
parent 28b070dafc
commit 598455f8d3
2 changed files with 11 additions and 5 deletions
+4
View File
@@ -18,6 +18,10 @@ func Open(path string) (*DB, error) {
if err != nil {
return nil, err
}
// SQLite only supports one concurrent writer; a pool of connections would
// cause SQLITE_BUSY errors when multiple proxy goroutines try to insert
// history entries at the same time.
conn.SetMaxOpenConns(1)
d := &DB{conn: conn, path: path}
if err := d.migrate(); err != nil {
conn.Close()