diff options
author | Lauris BH <lauris@nix.lv> | 2022-01-27 10:30:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 10:30:51 +0200 |
commit | 8038610a4279862a87e630e4f1d1077c510f9d15 (patch) | |
tree | 802489f8ddde899e76643ea157f9020f12ca1490 /routers/api/v1/repo/issue.go | |
parent | 2649eddcf0bb1190abab49c9d79ce19bfcf19e87 (diff) | |
download | gitea-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/api/v1/repo/issue.go')
-rw-r--r-- | routers/api/v1/repo/issue.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 5ce0c109e6..e2afa72498 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -188,7 +188,7 @@ func SearchIssues(ctx *context.APIContext) { } var issueIDs []int64 if len(keyword) > 0 && len(repoIDs) > 0 { - if issueIDs, err = issue_indexer.SearchIssuesByKeyword(repoIDs, keyword); err != nil { + if issueIDs, err = issue_indexer.SearchIssuesByKeyword(ctx, repoIDs, keyword); err != nil { ctx.Error(http.StatusInternalServerError, "SearchIssuesByKeyword", err) return } @@ -379,7 +379,7 @@ func ListIssues(ctx *context.APIContext) { var issueIDs []int64 var labelIDs []int64 if len(keyword) > 0 { - issueIDs, err = issue_indexer.SearchIssuesByKeyword([]int64{ctx.Repo.Repository.ID}, keyword) + issueIDs, err = issue_indexer.SearchIssuesByKeyword(ctx, []int64{ctx.Repo.Repository.ID}, keyword) if err != nil { ctx.Error(http.StatusInternalServerError, "SearchIssuesByKeyword", err) return |