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/user.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/user.go')
-rw-r--r-- | models/user.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go index 8d8afdfdb8..6484c8cf69 100644 --- a/models/user.go +++ b/models/user.go @@ -436,7 +436,7 @@ func (u *User) UploadAvatar(data []byte) error { m := resize.Resize(avatar.AvatarSize, avatar.AvatarSize, img, resize.NearestNeighbor) sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return err } @@ -715,7 +715,7 @@ func CreateUser(u *User) (err error) { u.MaxRepoCreation = -1 sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return err } @@ -1033,7 +1033,7 @@ func deleteUser(e *xorm.Session, u *User) error { // but issues/comments/pulls will be kept and shown as someone has been deleted. func DeleteUser(u *User) (err error) { sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return err } |