We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09bf5fe commit 8b9a55bCopy full SHA for 8b9a55b
pkg/zcache/config.go
@@ -3,6 +3,7 @@ package zcache
3
import (
4
"github.com/allegro/bigcache/v3"
5
"github.com/go-redis/redis/v8"
6
+ "math"
7
"time"
8
)
9
@@ -47,7 +48,12 @@ func (c *RemoteConfig) ToRedisConfig() *redis.Options {
47
48
}
49
50
func (c *LocalConfig) ToBigCacheConfig() bigcache.Config {
- return bigcache.DefaultConfig(time.Second * time.Duration(c.EvictionInSeconds))
51
+ eviction := time.Duration(c.EvictionInSeconds) * time.Second
52
+ if c.EvictionInSeconds < 0 {
53
+ eviction = time.Duration(math.MaxInt64)
54
+ }
55
+
56
+ return bigcache.DefaultConfig(eviction)
57
58
59
type CombinedConfig struct {
0 commit comments