diff --git a/src/FileCache/FileCache.cs b/src/FileCache/FileCache.cs index 6d89f82..84464a9 100644 --- a/src/FileCache/FileCache.cs +++ b/src/FileCache/FileCache.cs @@ -341,6 +341,14 @@ private void Init( _cleanInterval = cleanInterval; } + //set up cache manager + CacheManager = FileCacheManagerFactory.Create(manager); + CacheManager.CacheDir = CacheDir; + CacheManager.CacheSubFolder = _cacheSubFolder; + CacheManager.PolicySubFolder = _policySubFolder; + CacheManager.Binder = _binder; + CacheManager.AccessTimeout = new TimeSpan(); + //check to see if cache is in need of immediate cleaning if (ShouldClean()) { @@ -353,14 +361,6 @@ private void Init( UpdateCacheSizeAsync(); } - //set up cache manager - CacheManager = FileCacheManagerFactory.Create(manager); - CacheManager.CacheDir = CacheDir; - CacheManager.CacheSubFolder = _cacheSubFolder; - CacheManager.PolicySubFolder = _policySubFolder; - CacheManager.Binder = _binder; - CacheManager.AccessTimeout = new TimeSpan(); - MaxCacheSizeReached += FileCache_MaxCacheSizeReached; }