Fix TestSendParallel by using only a single DB connection
see https://github.com/mattn/go-sqlite3/issues/274 see https://github.com/mattn/go-sqlite3/issues/209 see https://stackoverflow.com/questions/32479071/sqlite3-error-database-is-locked-in-golang
This commit is contained in:
@@ -27,10 +27,14 @@ func NewDatabase(conf server.Config) (*Database, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
xdb.SetMaxOpenConns(5)
|
||||
xdb.SetMaxIdleConns(5)
|
||||
xdb.SetConnMaxLifetime(60 * time.Minute)
|
||||
xdb.SetConnMaxIdleTime(60 * time.Minute)
|
||||
if conf.DBSingleConn {
|
||||
xdb.SetMaxOpenConns(1)
|
||||
} else {
|
||||
xdb.SetMaxOpenConns(5)
|
||||
xdb.SetMaxIdleConns(5)
|
||||
xdb.SetConnMaxLifetime(60 * time.Minute)
|
||||
xdb.SetConnMaxIdleTime(60 * time.Minute)
|
||||
}
|
||||
|
||||
qqdb := sq.NewDB(xdb)
|
||||
|
||||
|
Reference in New Issue
Block a user