limit db pool

This commit is contained in:
Dan Ballard 2015-05-17 19:25:32 -07:00
parent 510fd216e1
commit 0a1464fd4c
1 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,10 @@ import (
"flag"
)
const VERSION = "0.1"
const (
VERSION = "0.1"
MAX_DB_CONNS = 10 // already excessive for personal app
)
type Config struct {
Sql struct {
@ -65,6 +68,8 @@ func dbConnect() {
fmt.Println("DB Error on Ping(): ", err)
os.Exit(-1)
}
db.SetMaxIdleConns(MAX_DB_CONNS)
}
func initTemplates() {