exposed configuration
This commit is contained in:
@ -35,7 +35,7 @@ type Handler struct {
|
||||
cache *bigcache.BigCache
|
||||
}
|
||||
|
||||
func NewHandler(binary string, eviction time.Duration) *Handler {
|
||||
func NewHandler(binary string, eviction time.Duration, maxmem int) *Handler {
|
||||
h := new(Handler)
|
||||
h.binary = binary
|
||||
h.uid = syscall.Getuid()
|
||||
@ -64,7 +64,7 @@ func NewHandler(binary string, eviction time.Duration) *Handler {
|
||||
}
|
||||
h.logger = logrus.StandardLogger()
|
||||
cacheConf := bigcache.DefaultConfig(eviction)
|
||||
cacheConf.HardMaxCacheSize = 500 * 1024 * 1024 // 500MB
|
||||
cacheConf.HardMaxCacheSize = maxmem
|
||||
cache, e := bigcache.NewBigCache(cacheConf)
|
||||
if e != nil {
|
||||
h.logger.Fatal(e.Error())
|
||||
|
Reference in New Issue
Block a user