Skip to content
Snippets Groups Projects
Verified Commit 8bd00793 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

fix: close opened database connections

parent bfcfd7a0
No related branches found
No related tags found
No related merge requests found
Pipeline #2982 passed
...@@ -31,6 +31,7 @@ func pageAlbumDetail(env PageEnvironment) http.Handler { ...@@ -31,6 +31,7 @@ func pageAlbumDetail(env PageEnvironment) http.Handler {
formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html") formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html")
return return
} }
defer result.Close()
var info shared.Album var info shared.Album
if result.Next() { if result.Next() {
...@@ -51,6 +52,7 @@ func pageAlbumDetail(env PageEnvironment) http.Handler { ...@@ -51,6 +52,7 @@ func pageAlbumDetail(env PageEnvironment) http.Handler {
WHERE album = $1 WHERE album = $1
ORDER BY position ORDER BY position
`, albumId) `, albumId)
defer result.Close()
if err != nil { if err != nil {
formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html") formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html")
return return
......
...@@ -37,6 +37,7 @@ func pageImageDetail(env PageEnvironment) http.Handler { ...@@ -37,6 +37,7 @@ func pageImageDetail(env PageEnvironment) http.Handler {
formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html") formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html")
return return
} }
defer result.Close()
var info shared.Image var info shared.Image
......
...@@ -71,6 +71,7 @@ func pageImageList(ctx PageEnvironment) http.Handler { ...@@ -71,6 +71,7 @@ func pageImageList(ctx PageEnvironment) http.Handler {
formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html") formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html")
return return
} }
defer result.Close()
var images []shared.Image var images []shared.Image
for result.Next() { for result.Next() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment