From 6ef39c67261d85c1f5cb1c740d4e9bd6b9cf8b36 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Sat, 11 Sep 2021 17:57:57 +0300 Subject: [PATCH] feat: disable gin logs --- db/db.go | 1 + main.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/db/db.go b/db/db.go index 1d8bfea..1e0a655 100644 --- a/db/db.go +++ b/db/db.go @@ -19,6 +19,7 @@ func Init() { log.Panicln(err) } + // TODO: take from config from env var Pool.Config().MaxConns = 5 log.Println("database - online") diff --git a/main.go b/main.go index a762a50..03fe7d9 100644 --- a/main.go +++ b/main.go @@ -41,7 +41,8 @@ func main() { instance := limiter.New(store, rate) middleware := mgin.NewMiddleware(instance) - router := gin.Default() + router := gin.New() + router.Use(gin.Recovery()) router.SetFuncMap(template.FuncMap{ "Iterate": func(count int) []int { var i int