Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
FlafyDev committed May 30, 2024
1 parent 538dc60 commit f9feada
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/managers/auto_nong_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ bool AutoNongManager::anySongExists(std::set<int> songIDs) {

void AutoNongManager::loadIndexesSchedule(float) { loadIndexes(); }

void _execute_with_delay(std::function<void()> callback, int delay_seconds) {
std::thread([callback, delay_seconds]() {
std::this_thread::sleep_for(std::chrono::seconds(delay_seconds));
callback();
}).detach();
}

void AutoNongManager::loadIndexes() {
std::vector<std::string> indexes =
Mod::get()->getSettingValue<MultiStringSettingStruct>("indexes").m_strings;
Expand All @@ -42,6 +49,10 @@ void AutoNongManager::loadIndexes() {
log::info("3");
jsonString = decompressGz(rVec);
log::info("4 {}", jsonString);
log::info("Pausing for 5 seconds...");
std::this_thread::sleep_for(std::chrono::seconds(5));
log::info("Resuming...");
log::info("4.5 {}", jsonString);
} else {
log::info("5");
jsonString = std::string(rVec.begin(), rVec.end());
Expand Down

0 comments on commit f9feada

Please sign in to comment.