Now fix bug with too many open connecitons
This commit is contained in:
@@ -14,6 +14,7 @@ func rootHandler(wr http.ResponseWriter, req *http.Request) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(wr, err.Error(), http.StatusInternalServerError)
|
http.Error(wr, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
defer store.Close()
|
||||||
|
|
||||||
articles, err := database.ArticlesForDay(store, time.Now())
|
articles, err := database.ArticlesForDay(store, time.Now())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -37,6 +38,7 @@ func articleHandler(wr http.ResponseWriter, req *http.Request) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(wr, err.Error(), http.StatusInternalServerError)
|
http.Error(wr, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
defer store.Close()
|
||||||
|
|
||||||
vars := mux.Vars(req)
|
vars := mux.Vars(req)
|
||||||
articleID, err := strconv.Atoi(vars["id"])
|
articleID, err := strconv.Atoi(vars["id"])
|
||||||
|
|||||||
Reference in New Issue
Block a user