set max db connection
This commit is contained in:
parent
4e5bcddb4b
commit
8a677a2130
4
main.go
4
main.go
@ -24,6 +24,10 @@ func main() {
|
|||||||
log.Fatal("cannot connect to db: ", err)
|
log.Fatal("cannot connect to db: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// limit db connection
|
||||||
|
dbConn.SetConnMaxLifetime(100)
|
||||||
|
dbConn.SetMaxOpenConns(100)
|
||||||
|
|
||||||
store := db.NewStore(dbConn)
|
store := db.NewStore(dbConn)
|
||||||
server, err := api.NewServer(config, store)
|
server, err := api.NewServer(config, store)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user