mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-23 14:00:03 +02:00
Stop various tests from adding to the source tree (#9515)
Instead of just adding test generated files to .gitignore prevent them from being produced in the first place. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
884173232f
commit
55cd33e124
6 changed files with 92 additions and 14 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"os"
|
||||
"strconv"
|
||||
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"github.com/blevesearch/bleve"
|
||||
"github.com/blevesearch/bleve/analysis/analyzer/custom"
|
||||
"github.com/blevesearch/bleve/analysis/token/lowercase"
|
||||
|
@ -184,6 +185,15 @@ func (b *BleveIndexer) Init() (bool, error) {
|
|||
return false, err
|
||||
}
|
||||
|
||||
// Close will close the bleve indexer
|
||||
func (b *BleveIndexer) Close() {
|
||||
if b.indexer != nil {
|
||||
if err := b.indexer.Close(); err != nil {
|
||||
log.Error("Error whilst closing indexer: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Index will save the index data
|
||||
func (b *BleveIndexer) Index(issues []*IndexerData) error {
|
||||
batch := rupture.NewFlushingBatch(b.indexer, maxBatchSize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue