1
0
forked from MTSR/mapserver

optional media repo (default: off)

This commit is contained in:
Thomas Rudin 2019-06-19 19:29:51 +02:00
parent 2ce963de47
commit 18c231375d
2 changed files with 10 additions and 5 deletions

View File

@ -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,

View File

@ -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