grafana/pkg/setting/setting_search.go
Artur Wierzbicki c3ca5405ce
Search: Add search index configuration options (#55525)
* Search: externalize config

* Search: update config descriptions

* Search: fix value

* Search: fix

* update

* Search: revert config values

* Search: rename copy/paste

* Search: fix tests
2022-09-20 19:09:55 -04:00

24 lines
633 B
Go

package setting
import (
"time"
"gopkg.in/ini.v1"
)
type SearchSettings struct {
FullReindexInterval time.Duration
IndexUpdateInterval time.Duration
DashboardLoadingBatchSize int
}
func readSearchSettings(iniFile *ini.File) SearchSettings {
s := SearchSettings{}
searchSection := iniFile.Section("search")
s.DashboardLoadingBatchSize = searchSection.Key("dashboard_loading_batch_size").MustInt(200)
s.FullReindexInterval = searchSection.Key("full_reindex_interval").MustDuration(5 * time.Minute)
s.IndexUpdateInterval = searchSection.Key("index_update_interval").MustDuration(10 * time.Second)
return s
}