Now fix bug with too many open connecitons

This commit is contained in:
Senad Uka
2022-02-15 04:49:40 +01:00
parent 7cb3620040
commit b3d4928663
2 changed files with 2 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ func rootHandler(wr http.ResponseWriter, req *http.Request) {
if err != nil {
http.Error(wr, err.Error(), http.StatusInternalServerError)
}
defer store.Close()
articles, err := database.ArticlesForDay(store, time.Now())
if err != nil {
@@ -37,6 +38,7 @@ func articleHandler(wr http.ResponseWriter, req *http.Request) {
if err != nil {
http.Error(wr, err.Error(), http.StatusInternalServerError)
}
defer store.Close()
vars := mux.Vars(req)
articleID, err := strconv.Atoi(vars["id"])

BIN
server

Binary file not shown.