aboutsummaryrefslogtreecommitdiffstats
path: root/models/attachment.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/attachment.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/attachment.go')
-rw-r--r--models/attachment.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/attachment.go b/models/attachment.go
index d800a47109..3b3521bf60 100644
--- a/models/attachment.go
+++ b/models/attachment.go
@@ -48,7 +48,7 @@ func (a *Attachment) AfterSet(colName string, _ xorm.Cell) {
// IncreaseDownloadCount is update download count + 1
func (a *Attachment) IncreaseDownloadCount() error {
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
// Update download count.
if _, err := sess.Exec("UPDATE `attachment` SET download_count=download_count+1 WHERE id=?", a.ID); err != nil {