From 5f37944dff7f8e48b3c5ce27bd1b77907b71f092 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Wed, 26 Jul 2017 02:30:47 -0700 Subject: [PATCH] Fix unclosed session bug (#2214) --- models/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/issue.go b/models/issue.go index e2772052f7..a83cfd6504 100644 --- a/models/issue.go +++ b/models/issue.go @@ -1097,8 +1097,8 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) { sess = x.Limit(setting.UI.IssuePagingNum, start) } else { sess = x.NewSession() - defer sess.Close() } + defer sess.Close() if len(opts.IssueIDs) > 0 { sess.In("issue.id", opts.IssueIDs)