mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Add max cons 1 if sqlite3
This commit is contained in:
@@ -123,6 +123,10 @@ func New(url *url.URL) (models.Datastore, error) {
|
|||||||
db.SetMaxIdleConns(maxIdleConns)
|
db.SetMaxIdleConns(maxIdleConns)
|
||||||
logrus.WithFields(logrus.Fields{"max_idle_connections": maxIdleConns, "datastore": driver}).Info("datastore dialed")
|
logrus.WithFields(logrus.Fields{"max_idle_connections": maxIdleConns, "datastore": driver}).Info("datastore dialed")
|
||||||
|
|
||||||
|
switch driver {
|
||||||
|
case "sqlite3":
|
||||||
|
db.SetMaxOpenConns(1)
|
||||||
|
}
|
||||||
for _, v := range tables {
|
for _, v := range tables {
|
||||||
_, err = db.Exec(v)
|
_, err = db.Exec(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user