1
0
Fork 0
forked from forgejo/forgejo

Add context.Context to more methods (#21546)

This PR adds a context parameter to a bunch of methods. Some helper
`xxxCtx()` methods got replaced with the normal name now.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
KN4CK3R 2022-11-19 09:12:33 +01:00 committed by GitHub
parent fefdb7ffd1
commit 044c754ea5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
148 changed files with 1411 additions and 1564 deletions

View file

@ -202,7 +202,7 @@ func Milestones(ctx *context.Context) {
return
}
showRepos, _, err := repo_model.SearchRepositoryByCondition(&repoOpts, userRepoCond, false)
showRepos, _, err := repo_model.SearchRepositoryByCondition(ctx, &repoOpts, userRepoCond, false)
if err != nil {
ctx.ServerError("SearchRepositoryByCondition", err)
return
@ -461,7 +461,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
// USING NON-FINAL STATE OF opts FOR A QUERY.
var issueCountByRepo map[int64]int64
if !forceEmpty {
issueCountByRepo, err = issues_model.CountIssuesByRepo(opts)
issueCountByRepo, err = issues_model.CountIssuesByRepo(ctx, opts)
if err != nil {
ctx.ServerError("CountIssuesByRepo", err)
return
@ -504,7 +504,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
// USING FINAL STATE OF opts FOR A QUERY.
var issues []*issues_model.Issue
if !forceEmpty {
issues, err = issues_model.Issues(opts)
issues, err = issues_model.Issues(ctx, opts)
if err != nil {
ctx.ServerError("Issues", err)
return