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:
zeripath 2019-12-28 02:08:05 +00:00 committed by Lunny Xiao
parent 884173232f
commit 55cd33e124
6 changed files with 92 additions and 14 deletions

View file

@ -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)