Updated analyzers

This commit is contained in:
Trial97
2021-09-20 10:43:29 +03:00
committed by Dan Christian Bogos
parent 6476c036b1
commit 173392b030
5 changed files with 22 additions and 13 deletions

View File

@@ -59,7 +59,7 @@ func (aS *AnalyzerService) SetFilterS(fS *engine.FilterS) {
}
func (aS *AnalyzerService) initDB() (err error) {
if aS.cfg.AnalyzerSCfg().DBPath == utils.EmptyString {
if aS.cfg.AnalyzerSCfg().IndexType == utils.MetaInternal {
aS.db, err = bleve.NewMemOnly(bleve.NewIndexMapping())
return
}

View File

@@ -169,7 +169,7 @@ func TestAnalyzersListenAndServe(t *testing.T) {
t.Fatal(err)
}
go func() {
time.Sleep(1)
time.Sleep(time.Nanosecond)
runtime.Gosched()
anz.db.Close()
}()
@@ -445,6 +445,7 @@ func TestAnalyzerSLogTrafficInternalDB(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
cfg.AnalyzerSCfg().DBPath = utils.EmptyString
cfg.AnalyzerSCfg().IndexType = utils.MetaInternal
cfg.AnalyzerSCfg().TTL = 30 * time.Minute
anz, err := NewAnalyzerService(cfg)
if err != nil {