summaryrefslogtreecommitdiffstats
path: root/models/migrations/migrations.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/migrations/migrations.go')
-rw-r--r--models/migrations/migrations.go17
1 files changed, 5 insertions, 12 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 2a54c497c1..99fd012480 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -167,13 +167,6 @@ Please try to upgrade to a lower version (>= v0.6.0) first, then upgrade to curr
return nil
}
-func sessionRelease(sess *xorm.Session) {
- if !sess.IsCommitedOrRollbacked {
- sess.Rollback()
- }
- sess.Close()
-}
-
func fixLocaleFileLoadPanic(_ *xorm.Engine) error {
cfg, err := ini.Load(setting.CustomConf)
if err != nil {
@@ -214,7 +207,7 @@ func trimCommitActionAppURLPrefix(x *xorm.Engine) error {
}
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
@@ -287,7 +280,7 @@ func issueToIssueLabel(x *xorm.Engine) error {
}
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
@@ -330,7 +323,7 @@ func attachmentRefactor(x *xorm.Engine) error {
}
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
@@ -408,7 +401,7 @@ func renamePullRequestFields(x *xorm.Engine) (err error) {
}
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
@@ -492,7 +485,7 @@ func generateOrgRandsAndSalt(x *xorm.Engine) (err error) {
}
sess := x.NewSession()
- defer sessionRelease(sess)
+ defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}