mirror of
https://github.com/kopia/kopia.git
synced 2026-06-11 15:48:40 -04:00
fix(general): change cache full logging frequency & message (#3193)
fix(general): change cache full logging frequency to once every 10 minutes Addresses concerns about too many messages in the logs (#3085) fix(general): avoid logging cache key. Instead log the cache description, which provides information about the types of contents being cached. Followups to #3085
This commit is contained in:
4
internal/cache/persistent_lru_cache.go
vendored
4
internal/cache/persistent_lru_cache.go
vendored
@@ -233,10 +233,10 @@ func (c *PersistentCache) Put(ctx context.Context, key string, data gather.Bytes
|
||||
// snapshots/restores from getting affected by the cache's storage use.
|
||||
if c.isCacheFullLocked() {
|
||||
// Limit warnings to one per minute max.
|
||||
if clock.Now().Sub(c.lastCacheWarning) > time.Minute {
|
||||
if clock.Now().Sub(c.lastCacheWarning) > 10*time.Minute {
|
||||
c.lastCacheWarning = clock.Now()
|
||||
|
||||
log(ctx).Warnf("Cache is full, unable to add %v into cache.", key)
|
||||
log(ctx).Warnf("Cache is full, unable to add item into '%s' cache.", c.description)
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user