summaryrefslogtreecommitdiffstats
path: root/routers/web/user/home.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2022-01-27 10:30:51 +0200
committerGitHub <noreply@github.com>2022-01-27 10:30:51 +0200
commit8038610a4279862a87e630e4f1d1077c510f9d15 (patch)
tree802489f8ddde899e76643ea157f9020f12ca1490 /routers/web/user/home.go
parent2649eddcf0bb1190abab49c9d79ce19bfcf19e87 (diff)
downloadgitea-8038610a4279862a87e630e4f1d1077c510f9d15.tar.gz
gitea-8038610a4279862a87e630e4f1d1077c510f9d15.zip
Automatically pause queue if index service is unavailable (#15066)
* Handle keyword search error when issue indexer service is not available * Implement automatic disabling and resume of code indexer queue
Diffstat (limited to 'routers/web/user/home.go')
-rw-r--r--routers/web/user/home.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index 13fa9bd8c4..33512d97c0 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -438,7 +438,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
// Execute keyword search for issues.
// USING NON-FINAL STATE OF opts FOR A QUERY.
- issueIDsFromSearch, err := issueIDsFromSearch(ctxUser, keyword, opts)
+ issueIDsFromSearch, err := issueIDsFromSearch(ctx, ctxUser, keyword, opts)
if err != nil {
ctx.ServerError("issueIDsFromSearch", err)
return
@@ -673,7 +673,7 @@ func getRepoIDs(reposQuery string) []int64 {
return repoIDs
}
-func issueIDsFromSearch(ctxUser *user_model.User, keyword string, opts *models.IssuesOptions) ([]int64, error) {
+func issueIDsFromSearch(ctx *context.Context, ctxUser *user_model.User, keyword string, opts *models.IssuesOptions) ([]int64, error) {
if len(keyword) == 0 {
return []int64{}, nil
}
@@ -682,7 +682,7 @@ func issueIDsFromSearch(ctxUser *user_model.User, keyword string, opts *models.I
if err != nil {
return nil, fmt.Errorf("GetRepoIDsForIssuesOptions: %v", err)
}
- issueIDsFromSearch, err := issue_indexer.SearchIssuesByKeyword(searchRepoIDs, keyword)
+ issueIDsFromSearch, err := issue_indexer.SearchIssuesByKeyword(ctx, searchRepoIDs, keyword)
if err != nil {
return nil, fmt.Errorf("SearchIssuesByKeyword: %v", err)
}