diff options
author | Lauris BH <lauris@nix.lv> | 2017-06-21 03:57:05 +0300 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-21 08:57:05 +0800 |
commit | 6db387a21e245dc4aa7f009ca60574e42d934ffb (patch) | |
tree | 5f5dcd1b4cd3409e3fc1c4e2a0799ce85a09c3c0 /models/repo.go | |
parent | 754482bf5d4922f0553c281ac525daff3f446c22 (diff) | |
download | gitea-6db387a21e245dc4aa7f009ca60574e42d934ffb.tar.gz gitea-6db387a21e245dc4aa7f009ca60574e42d934ffb.zip |
Refactor session close as xorm already does everything needed internally (#2020)
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/models/repo.go b/models/repo.go index f8fef47ebe..8d97138420 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1271,7 +1271,7 @@ func CreateRepository(u *User, opts CreateRepoOptions) (_ *Repository, err error } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return nil, err } @@ -1355,7 +1355,7 @@ func TransferOwnership(doer *User, newOwnerName string, repo *Repository) error } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return fmt.Errorf("sess.Begin: %v", err) } @@ -1580,7 +1580,7 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e // UpdateRepository updates a repository func UpdateRepository(repo *Repository, visibilityChanged bool) (err error) { sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return err } @@ -1625,7 +1625,7 @@ func DeleteRepository(uid, repoID int64) error { } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return err } @@ -2240,7 +2240,7 @@ func ForkRepository(u *User, oldRepo *Repository, name, desc string) (_ *Reposit } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return nil, err } @@ -2284,7 +2284,7 @@ func ForkRepository(u *User, oldRepo *Repository, name, desc string) (_ *Reposit // Copy LFS meta objects in new session sess2 := x.NewSession() - defer sessionRelease(sess2) + defer sess2.Close() if err = sess2.Begin(); err != nil { return nil, err } |