fix plugin monitor eating a whole cpu core

i must have messed this up when i changed the plugin monitor behavior
recently
This commit is contained in:
Lion Kortlepel 2022-07-20 14:42:07 +02:00
parent fd7b11f436
commit 2ed92c4aa1
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -60,10 +60,8 @@ void TPluginMonitor::operator()() {
} catch (const std::exception& e) { } catch (const std::exception& e) {
ToRemove.push_back(Pair.first); ToRemove.push_back(Pair.first);
} }
for (size_t i = 0; i < 3 && !Application::IsShuttingDown(); ++i) {
std::this_thread::sleep_for(std::chrono::seconds(1));
}
} }
Application::SleepSafeSeconds(3);
for (const auto& File : ToRemove) { for (const auto& File : ToRemove) {
mFileTimes.erase(File); mFileTimes.erase(File);
beammp_warnf("File \"{}\" couldn't be accessed, so it was removed from plugin hot reload monitor (probably got deleted)", File); beammp_warnf("File \"{}\" couldn't be accessed, so it was removed from plugin hot reload monitor (probably got deleted)", File);