File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 1
- // Copyright 2019 The Gitea Authors. All rights reserved.
1
+ // Copyright 2020 The Gitea Authors. All rights reserved.
2
2
// Use of this source code is governed by a MIT-style
3
3
// license that can be found in the LICENSE file.
4
4
Original file line number Diff line number Diff line change @@ -420,18 +420,11 @@ func InsertReviews(reviews []*Review) error {
420
420
for _ , c := range review .Comments {
421
421
c .ReviewID = review .ID
422
422
}
423
- }
424
423
425
- if err := sess .Commit (); err != nil {
426
- return err
427
- }
428
- sess .Close ()
429
-
430
- for _ , review := range reviews {
431
- if _ , err := x .NoAutoTime ().Insert (review .Comments ); err != nil {
424
+ if _ , err := sess .NoAutoTime ().Insert (review .Comments ); err != nil {
432
425
return err
433
426
}
434
427
}
435
428
436
- return nil
429
+ return sess . Commit ()
437
430
}
You can’t perform that action at this time.
0 commit comments