diff --git a/main.go b/main.go index 68c0774..0f8b41f 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,10 @@ func main() { log.Fatal("cannot connect to db: ", err) } + // limit db connection + dbConn.SetConnMaxLifetime(100) + dbConn.SetMaxOpenConns(100) + store := db.NewStore(dbConn) server, err := api.NewServer(config, store) if err != nil {