Skip to content

Commit

Permalink
fix sqlite db lock by reducing maximum open connections to 1 (IceWhal…
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerinus authored Dec 2, 2022
1 parent 3875827 commit be9a010
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sqlite/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func GetDb(dbPath string) *gorm.DB {
db, err := gorm.Open(sqlite.Open(dbPath+"/casaOS.db"), &gorm.Config{})
c, _ := db.DB()
c.SetMaxIdleConns(10)
c.SetMaxOpenConns(100)
c.SetMaxOpenConns(1)
c.SetConnMaxIdleTime(time.Second * 1000)
if err != nil {
logger.Error("sqlite connect error", zap.Any("db connect error", err))
Expand Down

0 comments on commit be9a010

Please sign in to comment.