optional media repo (default: off)
This commit is contained in:
parent
2ce963de47
commit
18c231375d
@ -17,6 +17,7 @@ type Config struct {
|
|||||||
EnableSearch bool `json:"enablesearch"`
|
EnableSearch bool `json:"enablesearch"`
|
||||||
EnableInitialRendering bool `json:"enableinitialrendering"`
|
EnableInitialRendering bool `json:"enableinitialrendering"`
|
||||||
EnableTransparency bool `json:"enabletransparency"`
|
EnableTransparency bool `json:"enabletransparency"`
|
||||||
|
EnableMediaRepository bool `json:"enablemediarepository"`
|
||||||
Webdev bool `json:"webdev"`
|
Webdev bool `json:"webdev"`
|
||||||
WebApi *WebApiConfig `json:"webapi"`
|
WebApi *WebApiConfig `json:"webapi"`
|
||||||
Layers []*layer.Layer `json:"layers"`
|
Layers []*layer.Layer `json:"layers"`
|
||||||
@ -172,6 +173,7 @@ func ParseConfig(filename string) (*Config, error) {
|
|||||||
EnableSearch: true,
|
EnableSearch: true,
|
||||||
EnableInitialRendering: true,
|
EnableInitialRendering: true,
|
||||||
EnableTransparency: false,
|
EnableTransparency: false,
|
||||||
|
EnableMediaRepository: false,
|
||||||
Webdev: false,
|
Webdev: false,
|
||||||
WebApi: &webapi,
|
WebApi: &webapi,
|
||||||
Layers: layers,
|
Layers: layers,
|
||||||
|
@ -146,12 +146,15 @@ func Setup(p params.ParamsType, cfg *Config) *App {
|
|||||||
|
|
||||||
//create media repo
|
//create media repo
|
||||||
repo := make(map[string][]byte)
|
repo := make(map[string][]byte)
|
||||||
|
|
||||||
|
if a.Config.EnableMediaRepository {
|
||||||
mediasize, _ := media.ScanDir(repo, ".", []string{"mapserver.tiles", ".git"})
|
mediasize, _ := media.ScanDir(repo, ".", []string{"mapserver.tiles", ".git"})
|
||||||
fields := logrus.Fields{
|
fields := logrus.Fields{
|
||||||
"count": len(repo),
|
"count": len(repo),
|
||||||
"bytes": mediasize,
|
"bytes": mediasize,
|
||||||
}
|
}
|
||||||
logrus.WithFields(fields).Info("Created media repository")
|
logrus.WithFields(fields).Info("Created media repository")
|
||||||
|
}
|
||||||
|
|
||||||
a.MediaRepo = repo
|
a.MediaRepo = repo
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user