allegro / allegro/bigcache

Cache keys are evicted before the TTL with reason 0(expired)

Aperta
#267 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Go
Stelle
8.2k
Fork
614
Merge medio
5g 12h
PR unite (30g)
1

Descrizione

```
bigcache.NewBigCache(bigcache.Config{
Shards: 128,
LifeWindow: 30 * time.Minute,
CleanWindow: 20 * time.Minute,
MaxEntriesInWindow: 200 * 30 * 60,
MaxEntrySize: 100,
Verbose: true,
Hasher: nil,
HardMaxCacheSize: 500,
OnRemove: nil,
OnRemoveWithReason: func(key string, entry []byte, reason bigcache.RemoveReason){
logger.Info("Cache eviction", zap.String("key", key), zap.Uint32("reason", uint32(reason)))
},
Logger: nil,
})
```

This is my configuration for Bigcache.

Problem statement:
The life window is set to 30 minutes. But, the cache keys are evicted before TTL(in 2/3 minutes). I have logged the OnRemoveWithReason. The reason is always 0 (Expired).

What am I missing?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.