diff --git a/src/managers/BetterInfoCache.cpp b/src/managers/BetterInfoCache.cpp index 2d8f5ac..b0031fb 100644 --- a/src/managers/BetterInfoCache.cpp +++ b/src/managers/BetterInfoCache.cpp @@ -3,6 +3,7 @@ #include "../utils.hpp" #include "../layers/FoundListsPopup.h" +#include "Geode/utils/general.hpp" bool BetterInfoCache::init(){ if(!BaseJsonManager::init("cache.json")) return false; @@ -14,16 +15,31 @@ bool BetterInfoCache::init(){ void BetterInfoCache::finishLoading(){ auto now = BetterInfo::timeInMs(); - auto GLM = GameLevelManager::sharedState(); checkClaimableLists(); cacheRatedLists(); cacheFollowedCreators(); - checkLevelsFromDict(GLM->m_onlineLevels); - checkLevelsFromDict(GLM->m_dailyLevels); - log::debug("Finished 2nd stage loading BetterInfoCache in {} ms", BetterInfo::timeInMs() - now); + + std::thread([this] { + thread::setName("BI 3rd Stage Sleep"); + using namespace std::chrono_literals; + std::this_thread::sleep_for(120000ms); + + Loader::get()->queueInMainThread([this] { + auto now = BetterInfo::timeInMs(); + log::debug("Starting 3rd stage loading BetterInfoCache"); + + auto GLM = GameLevelManager::sharedState(); + checkLevelsFromDict(GLM->m_onlineLevels); + checkLevelsFromDict(GLM->m_dailyLevels); + + log::debug("Finished 3rd stage loading BetterInfoCache in {} ms", BetterInfo::timeInMs() - now); + }); + }).detach(); + + } void BetterInfoCache::validateLoadedData() { @@ -65,7 +81,7 @@ void BetterInfoCache::cacheFollowedCreators() { }); using namespace std::chrono_literals; - std::this_thread::sleep_for(500ms); + std::this_thread::sleep_for(5000ms); } }).detach(); }