Example #1
0
        private static void CheckCacheSize(AccountCache cache)
        {
            var totalCacheSize   = cache.Sum(x => System.IO.File.Exists(x.Path) ? new System.IO.FileInfo(x.Path).Length : 0);
            var totalCacheSizeMB = (totalCacheSize / 1024f / 1024f);

            if (totalCacheSizeMB > 64)
            {
                System.Console.WriteLine("Flushing cache due to size...");
                cache.DeleteAll();
            }
        }
Example #2
0
		private static void CheckCacheSize(AccountCache cache)
		{
			var totalCacheSize = cache.Sum(x => System.IO.File.Exists(x.Path) ? new System.IO.FileInfo(x.Path).Length : 0);
			var totalCacheSizeMB = (totalCacheSize / 1024f / 1024f);

			if (totalCacheSizeMB > 64)
			{
				System.Console.WriteLine("Flushing cache due to size...");
				cache.DeleteAll();
			}
		}