mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 06:34:36 -04:00
Refactor session close as xorm already does everything needed internally (#2020)
This commit is contained in:
parent
754482bf5d
commit
6db387a21e
23 changed files with 60 additions and 74 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue