#11607 Cleanup time of temporary files is now configurable

This commit is contained in:
Anton Sergeyev
2018-06-14 12:35:22 +05:00
parent 0cc8ccdaa5
commit 516839d7b2
6 changed files with 70 additions and 1 deletions
+6
View File
@@ -20,6 +20,7 @@ import (
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/util"
"time"
)
type Scheme string
@@ -195,6 +196,8 @@ type Cfg struct {
PhantomDir string
RendererUrl string
DisableBruteForceLoginProtection bool
TempDataLifetime time.Duration
}
type CommandLineArgs struct {
@@ -637,6 +640,9 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
cfg.RendererUrl = renderSec.Key("server_url").String()
cfg.ImagesDir = filepath.Join(DataPath, "png")
cfg.PhantomDir = filepath.Join(HomePath, "tools/phantomjs")
cfg.TempDataLifetime = iniFile.Section("paths").Key("temp_data_lifetime").MustDuration(
time.Duration(time.Second*3600*24),
)
analytics := iniFile.Section("analytics")
ReportingEnabled = analytics.Key("reporting_enabled").MustBool(true)