mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 08:30:50 +00:00
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
This commit is contained in:
parent
2649eddcf0
commit
8038610a42
28 changed files with 522 additions and 151 deletions
|
@ -5,6 +5,7 @@
|
|||
package code
|
||||
|
||||
import (
|
||||
"context"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
|
@ -65,7 +66,7 @@ func testIndexer(name string, t *testing.T, indexer Indexer) {
|
|||
|
||||
for _, kw := range keywords {
|
||||
t.Run(kw.Keyword, func(t *testing.T) {
|
||||
total, res, langs, err := indexer.Search(kw.RepoIDs, "", kw.Keyword, 1, 10, false)
|
||||
total, res, langs, err := indexer.Search(context.TODO(), kw.RepoIDs, "", kw.Keyword, 1, 10, false)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, len(kw.IDs), total)
|
||||
assert.Len(t, langs, kw.Langs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue