Commit 5d50b4e7 authored by ale's avatar ale

Fix sqlite locking issues

parent b5dc3093
Pipeline #7152 passed with stages
in 1 minute and 52 seconds
......@@ -18,6 +18,12 @@ func openDB(dbDriver, dbURI string) (*sql.DB, error) {
return nil, err
}
// Serialize connections for the sqlite driver, to
// prevent locking issues.
if dbDriver == "sqlite3" {
db.SetMaxOpenConns(1)
}
if err = runDatabaseMigrations(db, dbDriver); err != nil {
db.Close() // nolint
return nil, err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment