Skip to content

Commit

Permalink
SetMaxOpenConns(10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurrium committed Dec 20, 2023
1 parent 4331b21 commit 5736886
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webapp/go/app.go
Expand Up @@ -1396,6 +1396,12 @@ func main() {
}
defer db.Close()

maxOpenConns := 10
db.SetMaxOpenConns(maxOpenConns)
db.SetMaxIdleConns(maxOpenConns)
db.SetConnMaxLifetime(time.Second * time.Duration(maxOpenConns))
db.SetConnMaxIdleTime(time.Second * time.Duration(maxOpenConns))

r := chi.NewRouter()

r.Use(sessionManager.LoadAndSave)
Expand Down

0 comments on commit 5736886

Please sign in to comment.