diff options
Diffstat (limited to 'models/task.go')
-rw-r--r-- | models/task.go | 12 |
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 } |