mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-16 23:12:43 +00:00
Add queue for code indexer (#10332)
* Add queue for code indexer * Fix lint * Fix test * Fix lint * Fix bug * Fix bug * Fix lint * Add noqueue * Fix tests * Rename noqueue to immediate
This commit is contained in:
parent
a722dd72db
commit
91e7ad569a
10 changed files with 233 additions and 171 deletions
|
@ -7,7 +7,6 @@ package integrations
|
|||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
code_indexer "code.gitea.io/gitea/modules/indexer/code"
|
||||
|
@ -62,14 +61,6 @@ func testSearch(t *testing.T, url string, expected []string) {
|
|||
assert.EqualValues(t, expected, filenames)
|
||||
}
|
||||
|
||||
func executeIndexer(t *testing.T, repo *models.Repository, op func(*models.Repository, ...chan<- error)) {
|
||||
waiter := make(chan error, 1)
|
||||
op(repo, waiter)
|
||||
|
||||
select {
|
||||
case err := <-waiter:
|
||||
assert.NoError(t, err)
|
||||
case <-time.After(1 * time.Minute):
|
||||
assert.Fail(t, "Repository indexer took too long")
|
||||
}
|
||||
func executeIndexer(t *testing.T, repo *models.Repository, op func(*models.Repository)) {
|
||||
op(repo)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue