From 1b6143462362c0923c48ebad9a88a1bc5747ac78 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 22 May 2023 03:24:03 +0400 Subject: [PATCH] Deleted no more needed code for closing of a guestbook DB inside a Handlers struct. --- cmd/dwelling-home/main.go | 1 - internal/http/handlers.go | 4 ---- 2 files changed, 5 deletions(-) diff --git a/cmd/dwelling-home/main.go b/cmd/dwelling-home/main.go index a61e75a..c2b6f43 100644 --- a/cmd/dwelling-home/main.go +++ b/cmd/dwelling-home/main.go @@ -66,7 +66,6 @@ func main() { defer mindflowDB.Close() hand := http.NewHandlers(*captchaExpiry, *guestbookOwner, *guestbookPageSize, guestbookDB, mindflowDB) - defer hand.CloseDB() srv := http.NewHttpServer() diff --git a/internal/http/handlers.go b/internal/http/handlers.go index 35ddc0b..90a1a2f 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -34,10 +34,6 @@ func NewHandlers(captchaExpire time.Duration, gbOwner string, gbPageSize int64, guestbookPageSize: gbPageSize} } -func (h *Handlers) CloseDB() { - h.guestbookDB.Close() -} - func (h *Handlers) Index(w http.ResponseWriter, r *http.Request) { web.Index("", w) }