diff --git a/app/config.go b/app/config.go index b55c989..79d60b6 100644 --- a/app/config.go +++ b/app/config.go @@ -17,6 +17,7 @@ type Config struct { EnableSearch bool `json:"enablesearch"` EnableInitialRendering bool `json:"enableinitialrendering"` EnableTransparency bool `json:"enabletransparency"` + EnableMediaRepository bool `json:"enablemediarepository"` Webdev bool `json:"webdev"` WebApi *WebApiConfig `json:"webapi"` Layers []*layer.Layer `json:"layers"` @@ -172,6 +173,7 @@ func ParseConfig(filename string) (*Config, error) { EnableSearch: true, EnableInitialRendering: true, EnableTransparency: false, + EnableMediaRepository: false, Webdev: false, WebApi: &webapi, Layers: layers, diff --git a/app/setup.go b/app/setup.go index 1138fc6..edf8e9f 100644 --- a/app/setup.go +++ b/app/setup.go @@ -146,12 +146,15 @@ func Setup(p params.ParamsType, cfg *Config) *App { //create media repo repo := make(map[string][]byte) - mediasize, _ := media.ScanDir(repo, ".", []string{"mapserver.tiles", ".git"}) - fields := logrus.Fields{ - "count": len(repo), - "bytes": mediasize, + + if a.Config.EnableMediaRepository { + mediasize, _ := media.ScanDir(repo, ".", []string{"mapserver.tiles", ".git"}) + fields := logrus.Fields{ + "count": len(repo), + "bytes": mediasize, + } + logrus.WithFields(fields).Info("Created media repository") } - logrus.WithFields(fields).Info("Created media repository") a.MediaRepo = repo