diff --git a/v3/collections/expire_cache.go b/v3/collections/expire_cache.go index 9ee90091..8c667345 100644 --- a/v3/collections/expire_cache.go +++ b/v3/collections/expire_cache.go @@ -19,6 +19,7 @@ import ( "sync" "time" + "github.com/mailgun/holster/v3/syncutil" "github.com/pkg/errors" ) @@ -139,7 +140,7 @@ func (c *ExpireCache) Peek(key interface{}) (value interface{}, ok bool) { // Processes each item in the cache in a thread safe way, such that the cache can be in use // while processing items in the cache func (c *ExpireCache) Each(concurrent int, callBack func(key interface{}, value interface{}) error) []error { - fanOut := NewFanOut(concurrent) + fanOut := syncutil.NewFanOut(concurrent) keys := c.Keys() for _, key := range keys { diff --git a/v3/collections/lru_cache.go b/v3/collections/lru_cache.go index b66c1b84..233b7639 100644 --- a/v3/collections/lru_cache.go +++ b/v3/collections/lru_cache.go @@ -21,6 +21,8 @@ import ( "container/list" "sync" "time" + + "github.com/mailgun/holster/v3/syncutil" ) // Holds stats collected about the cache @@ -197,7 +199,7 @@ func (c *LRUCache) Peek(key interface{}) (value interface{}, ok bool) { // while processing items in the cache. Processing the cache with `Each()` does not update // the expiration or last used. func (c LRUCache) Each(concurrent int, callBack func(key interface{}, value interface{}) error) []error { - fanOut := NewFanOut(concurrent) + fanOut := syncutil.NewFanOut(concurrent) keys := c.Keys() for _, key := range keys {