Previews: remove dashboard previews backend (#66176)

* remove dashboard previews backend

* remove dashboard previews backend

* bring back the migration

* bring back the migration

* bring back the migration
This commit is contained in:
Artur Wierzbicki
2023-04-13 21:42:24 +04:00
committed by GitHub
parent e0b2aeffa3
commit 2136e680c4
37 changed files with 45 additions and 2695 deletions
-3
View File
@@ -484,8 +484,6 @@ type Cfg struct {
// Query history
QueryHistoryEnabled bool
DashboardPreviews DashboardPreviewsSettings
Storage StorageSettings
Search SearchSettings
@@ -1116,7 +1114,6 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
cfg.readDataSourcesSettings()
cfg.DashboardPreviews = readDashboardPreviewsSettings(iniFile)
cfg.Storage = readStorageSettings(iniFile)
cfg.Search = readSearchSettings(iniFile)
-31
View File
@@ -1,31 +0,0 @@
package setting
import (
"time"
"gopkg.in/ini.v1"
)
type DashboardPreviewsSettings struct {
SchedulerInterval time.Duration
MaxCrawlDuration time.Duration
RenderingTimeout time.Duration
CrawlThreadCount uint32
}
func readDashboardPreviewsSettings(iniFile *ini.File) DashboardPreviewsSettings {
maxThreadCount := uint32(20)
s := DashboardPreviewsSettings{}
previewsCrawlerSection := iniFile.Section("dashboard_previews.crawler")
s.CrawlThreadCount = uint32(previewsCrawlerSection.Key("thread_count").MustUint(6))
if s.CrawlThreadCount > maxThreadCount {
s.CrawlThreadCount = maxThreadCount
}
s.SchedulerInterval = previewsCrawlerSection.Key("scheduler_interval").MustDuration(12 * time.Hour)
s.MaxCrawlDuration = previewsCrawlerSection.Key("max_crawl_duration").MustDuration(1 * time.Hour)
s.RenderingTimeout = previewsCrawlerSection.Key("rendering_timeout").MustDuration(20 * time.Second)
return s
}