func newConfCache()

in internal/plugin/conf.go [53:67]


func newConfCache(ttl time.Duration) *ConfCache {
	cc := &ConfCache{
		tokenCounter: 0,
	}
	for _, c := range []**ttlcache.Cache{&cc.tokenCache, &cc.keyCache} {
		cache := ttlcache.NewCache()
		err := cache.SetTTL(ttl)
		if err != nil {
			log.Fatalf("failed to set global ttl for cache: %s", err)
		}
		cache.SkipTTLExtensionOnHit(false)
		*c = cache
	}
	return cc
}