mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/workingsetcache: typo fixes after d0c830039d
This commit is contained in:
parent
d0c830039d
commit
4f0003f182
1 changed files with 1 additions and 1 deletions
|
@ -80,7 +80,6 @@ func Load(filePath string, maxBytes int, expireDuration time.Duration) *Cache {
|
||||||
// Stop must be called on the returned cache when it is no longer needed.
|
// Stop must be called on the returned cache when it is no longer needed.
|
||||||
func New(maxBytes int, expireDuration time.Duration) *Cache {
|
func New(maxBytes int, expireDuration time.Duration) *Cache {
|
||||||
// Split maxBytes between curr and prev caches.
|
// Split maxBytes between curr and prev caches.
|
||||||
maxBytes /= 2
|
|
||||||
curr := fastcache.New(maxBytes)
|
curr := fastcache.New(maxBytes)
|
||||||
c := newCacheInternal(curr, fastcache.New(1024), maxBytes, split)
|
c := newCacheInternal(curr, fastcache.New(1024), maxBytes, split)
|
||||||
c.runWatchers(expireDuration)
|
c.runWatchers(expireDuration)
|
||||||
|
@ -89,6 +88,7 @@ func New(maxBytes int, expireDuration time.Duration) *Cache {
|
||||||
|
|
||||||
func newCacheInternal(curr, prev *fastcache.Cache, maxBytes, mode int) *Cache {
|
func newCacheInternal(curr, prev *fastcache.Cache, maxBytes, mode int) *Cache {
|
||||||
var c Cache
|
var c Cache
|
||||||
|
c.maxBytes = maxBytes
|
||||||
c.curr.Store(curr)
|
c.curr.Store(curr)
|
||||||
c.prev.Store(prev)
|
c.prev.Store(prev)
|
||||||
c.stopCh = make(chan struct{})
|
c.stopCh = make(chan struct{})
|
||||||
|
|
Loading…
Reference in a new issue