Cleanup cache clearing to re-enable threaded clear

fixup silly mis-edits
master
Beq 2021-07-04 00:11:19 +01:00
parent 6d6c48d609
commit cbe3910620
3 changed files with 14 additions and 7 deletions

View File

@ -344,6 +344,7 @@ void LLDiskCache::prepopulateCacheWithStatic(const std::string& from_folder)
void LLDiskCache::clearCache()
{
LL_INFOS() << "clearing cache " << mCacheDir << LL_ENDL;
/**
* See notes on performance in dirFileSize(..) - there may be
* a quicker way to do this by operating on the parent dir vs
@ -377,17 +378,18 @@ void LLDiskCache::clearCache()
}
}
}
// <FS:Beq> add static assets into the new cache after clear
// <FS:Beq> add static assets into the new cache after clear
// For everything we populate FS specific assets to allow future updates
auto static_assets_folder = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "fs_static_assets");
auto static_assets_folder = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "fs_static_assets");
prepopulateCacheWithStatic(static_assets_folder);
#ifdef OPENSIM
// For OPENSIM we need to populate the static assets
static_assets_folder = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "static_assets");
static_assets_folder = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "static_assets");
prepopulateCacheWithStatic(static_assets_folder);
#endif
// </FS:Beq>
// </FS:Beq>
}
LL_INFOS() << "Cleared cache " << mCacheDir << LL_ENDL;
}
uintmax_t LLDiskCache::dirFileSize(const std::string dir)

View File

@ -5013,8 +5013,10 @@ bool LLAppViewer::initCache()
gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false);
LL_INFOS("AppCache") << "Scheduling texture purge, based on PurgeCache* settings." << LL_ENDL;
mPurgeCache = true;
// STORM-1141 force purgeAllTextures to get called to prevent a crash here. -brad
texture_cache_mismatch = true;
// <FS:Beq> No longer needed
// // STORM-1141 force purgeAllTextures to get called to prevent a crash here. -brad
// texture_cache_mismatch = true;
// </FS:Beq>
}
// <FS> If the J2C has changed since the last run, clear the cache
@ -5085,7 +5087,7 @@ bool LLAppViewer::initCache()
LLAppViewer::getPurgeDiskCacheThread()->start();
// <FS:Ansariel> FIRE-13066
if (mPurgeTextures && !read_only)
if (!mPurgeCache && mPurgeTextures && !read_only) // <FS:Beq> no need to purge textures if we already purged the cache above
{
LL_INFOS("AppCache") << "Purging Texture Cache..." << LL_ENDL;
LLSplashScreen::update(LLTrans::getString("StartupClearingTextureCache"));

View File

@ -1238,7 +1238,10 @@ DWORD WINAPI purgeThread( LPVOID lpParameter )
::FindClose( hFindHandle );
for( auto dir : vctDirs )
{
LL_INFOS("CachePurge") << "Removing an old cache" << LL_ENDL;
deleteCacheDirectory( dir );
}
return 0;
}