forked from MTSR/mapserver
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"`
|
||||
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,
|
||||
|
13
app/setup.go
13
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user