parent
4579ca4e2f
commit
c27f9e18f6
|
@ -62,6 +62,7 @@ type Configuration struct {
|
|||
AppName string `mapstructure:"app_name,omitempty"`
|
||||
BackendID string `mapstructure:"backend_id,omitempty"`
|
||||
BuildEnv string `mapstructure:"build_env,omitempty"`
|
||||
CacheSizes map[string]CacheSize `mapstructure:"cache_sizes,omitempty"`
|
||||
ClusterID string `mapstructure:"cluster_id,omitempty"`
|
||||
Chunks map[string]Chunk `mapstructure:"chunks,omitempty"`
|
||||
DBMS string `mapstructure:"dbms,omitempty"`
|
||||
|
@ -87,6 +88,16 @@ type Configuration struct {
|
|||
Workers map[string]Worker `mapstructure:"workers,omitempty"`
|
||||
}
|
||||
|
||||
// GetCacheSize returns the named cache size
|
||||
func GetCacheSize(name string) int64 {
|
||||
obj, ok := config.CacheSizes[name]
|
||||
if ok {
|
||||
return obj.Increment
|
||||
}
|
||||
sugar.Warnf("app.GetCacheSize: unknown cache size identifier: %s", name)
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetPDFRenderEngine returns a config file parameter
|
||||
func GetPDFRenderEngine() string {
|
||||
return config.PDFRenderEngine
|
||||
|
|
Loading…
Reference in New Issue