mirror of
https://github.com/go-gitea/gitea
synced 2025-08-04 08:38:37 +00: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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user