From 729b62dce644ad603fd23bbe9dff171798f9c5f7 Mon Sep 17 00:00:00 2001 From: Marcin Kaciuba Date: Sun, 31 Mar 2019 20:56:55 +0200 Subject: [PATCH] fix(config): add default for cache config --- pkg/config/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index e78fd17..36a2312 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -250,6 +250,14 @@ func (c *Config) validateServer() error { c.Server.QueueLen = 5 } + if c.Server.Cache.MaxCacheItemSize == 0 { + c.Server.Cache.MaxCacheItemSize = 50 * 1024 + } + + if c.Server.Cache.Type == "" { + c.Server.Cache.Type = "memory" + } + if c.Server.PlaceholderStr != "" { buf, err := helpers.FetchObject(c.Server.PlaceholderStr) if err != nil {