From 068d2a9b027aea531d816b606ba8a81417bea46d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 1 Apr 2023 16:16:53 +0200 Subject: [PATCH] Fix disk cache after merge --- indra/llfilesystem/lldiskcache.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 24e372f335..da3530604d 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -115,8 +115,12 @@ void LLDiskCache::purge() #endif if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) { - boost::filesystem::directory_iterator iter(cache_path, ec); - while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + // Optimize asset simple disk cache + //boost::filesystem::directory_iterator iter(cache_path, ec); + //while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + boost::filesystem::recursive_directory_iterator iter(cache_path, ec); + while (iter != boost::filesystem::recursive_directory_iterator() && !ec.failed()) + // { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { @@ -469,8 +473,12 @@ void LLDiskCache::clearCache() #endif if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) { - boost::filesystem::directory_iterator iter(cache_path, ec); - while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + // Optimize asset simple disk cache + //boost::filesystem::directory_iterator iter(cache_path, ec); + //while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + boost::filesystem::recursive_directory_iterator iter(cache_path, ec); + while (iter != boost::filesystem::recursive_directory_iterator() && !ec.failed()) + // { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { @@ -547,8 +555,12 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir) #endif if (boost::filesystem::is_directory(dir_path, ec) && !ec.failed()) { - boost::filesystem::directory_iterator iter(dir_path, ec); - while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + // Optimize asset simple disk cache + //boost::filesystem::directory_iterator iter(dir_path, ec); + //while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + boost::filesystem::recursive_directory_iterator iter(dir_path, ec); + while (iter != boost::filesystem::recursive_directory_iterator() && !ec.failed()) + // { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) {