Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
This commit is contained in:
parent
d81e31ad78
commit
fd7d83ace6
232 changed files with 1463 additions and 2108 deletions
|
@ -48,7 +48,7 @@ func UpdateComment(c *models.Comment, doer *user_model.User, oldContent string)
|
|||
return err
|
||||
}
|
||||
if !hasContentHistory {
|
||||
if err = issues.SaveIssueContentHistory(db.GetEngine(db.DefaultContext), c.PosterID, c.IssueID, c.ID,
|
||||
if err = issues.SaveIssueContentHistory(db.DefaultContext, c.PosterID, c.IssueID, c.ID,
|
||||
c.CreatedUnix, oldContent, true); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ func UpdateComment(c *models.Comment, doer *user_model.User, oldContent string)
|
|||
}
|
||||
|
||||
if needsContentHistory {
|
||||
err := issues.SaveIssueContentHistory(db.GetEngine(db.DefaultContext), doer.ID, c.IssueID, c.ID, timeutil.TimeStampNow(), c.Content, false)
|
||||
err := issues.SaveIssueContentHistory(db.DefaultContext, doer.ID, c.IssueID, c.ID, timeutil.TimeStampNow(), c.Content, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue