Fix: exec sql with session

This commit is contained in:
Chongyi Zheng 2022-07-12 21:36:56 -04:00
parent faa0d0b76e
commit 58958074f2
No known key found for this signature in database
GPG Key ID: CC2953E050C19686
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ func InsertMilestones(ms ...*issues_model.Milestone) (err error) {
}
}
if _, err = db.Exec(ctx, "UPDATE `repository` SET num_milestones = num_milestones + ? WHERE id = ?", len(ms), ms[0].RepoID); err != nil {
if _, err = sess.Exec(ctx, "UPDATE `repository` SET num_milestones = num_milestones + ? WHERE id = ?", len(ms), ms[0].RepoID); err != nil {
return err
}
return committer.Commit()