summaryrefslogtreecommitdiffstats
path: root/models/task.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-21 23:41:00 +0800
committerGitHub <noreply@github.com>2021-11-21 23:41:00 +0800
commitd710af6669654f27f02b69d7ef1ba563e7d58a90 (patch)
tree9727f468a570106293dc90beb70035180bbb7e8e /models/task.go
parent0add627182388ac63fd04b94cdf912fb87fd0326 (diff)
downloadgitea-d710af6669654f27f02b69d7ef1ba563e7d58a90.tar.gz
gitea-d710af6669654f27f02b69d7ef1ba563e7d58a90.zip
Remove NewSession method from db.Engine interface (#17577)
* Remove NewSession method from db.Engine interface * Fix bug * Some improvements * Fix bug * Fix test * Use XXXBean instead of XXXExample
Diffstat (limited to 'models/task.go')
-rw-r--r--models/task.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/models/task.go b/models/task.go
index c8af1a4967..9bff00cd8c 100644
--- a/models/task.go
+++ b/models/task.go
@@ -253,14 +253,6 @@ func FinishMigrateTask(task *Task) error {
}
task.PayloadContent = string(confBytes)
- sess := db.NewSession(db.DefaultContext)
- defer sess.Close()
- if err := sess.Begin(); err != nil {
- return err
- }
- if _, err := sess.ID(task.ID).Cols("status", "end_time", "payload_content").Update(task); err != nil {
- return err
- }
-
- return sess.Commit()
+ _, err = db.GetEngine(db.DefaultContext).ID(task.ID).Cols("status", "end_time", "payload_content").Update(task)
+ return err
}