Remove unneeded loop

This commit is contained in:
badaix 2020-03-12 23:47:23 +01:00
parent d49b5c251c
commit 238116071a

View file

@ -243,19 +243,15 @@ void Controller::worker()
/// Main loop /// Main loop
while (active_) while (active_)
{ {
LOG(DEBUG) << "Main loop\n"; if (async_exception_)
for (size_t n = 0; n < 10 && active_; ++n)
{ {
chronos::sleep(100); LOG(DEBUG) << "Async exception\n";
if (async_exception_) std::rethrow_exception(async_exception_);
{
LOG(DEBUG) << "Async exception\n";
std::rethrow_exception(async_exception_);
}
} }
if (sendTimeSyncMessage(1000ms)) if (sendTimeSyncMessage(1000ms))
LOG(DEBUG) << "time sync main loop\n"; LOG(DEBUG) << "time sync main loop\n";
this_thread::sleep_for(100ms);
} }
} }
catch (const std::exception& e) catch (const std::exception& e)