summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-06-21 03:57:05 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-06-21 08:57:05 +0800
commit6db387a21e245dc4aa7f009ca60574e42d934ffb (patch)
tree5f5dcd1b4cd3409e3fc1c4e2a0799ce85a09c3c0 /models/issue.go
parent754482bf5d4922f0553c281ac525daff3f446c22 (diff)
downloadgitea-6db387a21e245dc4aa7f009ca60574e42d934ffb.tar.gz
gitea-6db387a21e245dc4aa7f009ca60574e42d934ffb.zip
Refactor session close as xorm already does everything needed internally (#2020)
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/models/issue.go b/models/issue.go
index d4d0a5a2ff..b5553b7c82 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -406,7 +406,7 @@ func (issue *Issue) clearLabels(e *xorm.Session, doer *User) (err error) {
// Triggers appropriate WebHooks, if any.
func (issue *Issue) ClearLabels(doer *User) (err error) {
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
@@ -470,7 +470,7 @@ func (ts labelSorter) Swap(i, j int) {
// Triggers appropriate WebHooks, if any.
func (issue *Issue) ReplaceLabels(labels []*Label, doer *User) (err error) {
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
@@ -598,7 +598,7 @@ func (issue *Issue) changeStatus(e *xorm.Session, doer *User, repo *Repository,
// ChangeStatus changes issue status to open or closed.
func (issue *Issue) ChangeStatus(doer *User, repo *Repository, isClosed bool) (err error) {
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
@@ -899,7 +899,7 @@ func newIssue(e *xorm.Session, doer *User, opts NewIssueOptions) (err error) {
// NewIssue creates new issue with labels for repository.
func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string) (err error) {
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}