Skip to content

Commit

Permalink
Add warning for cache jitter larger than expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreF committed Mar 5, 2021
1 parent 8abfcd2 commit fa6d397
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions go-auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ func setCache(authOpts map[string]string) {
}
}

if authJitterSeconds > authCacheSeconds {
authJitterSeconds = authCacheSeconds
log.Warningf("authJitterSeconds is larger than authCacheSeconds, defaulting to %d", authJitterSeconds)
}

if aclCacheSec, ok := authOpts["acl_cache_seconds"]; ok {
aclSec, err := strconv.ParseInt(aclCacheSec, 10, 64)
if err == nil {
Expand All @@ -413,6 +418,11 @@ func setCache(authOpts map[string]string) {
}
}

if aclJitterSeconds > aclCacheSeconds {
aclJitterSeconds = aclCacheSeconds
log.Warningf("aclJitterSeconds is larger than aclCacheSeconds, defaulting to %d", aclJitterSeconds)
}

reset := false
if cacheReset, ok := authOpts["cache_reset"]; ok && cacheReset == "true" {
reset = true
Expand Down

0 comments on commit fa6d397

Please sign in to comment.