mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
c3ca5405ce
* Search: externalize config * Search: update config descriptions * Search: fix value * Search: fix * update * Search: revert config values * Search: rename copy/paste * Search: fix tests
24 lines
633 B
Go
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
|
|
}
|