mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Refactor session close as xorm already does everything needed internally (#2020)
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user