Reformat source

This commit is contained in:
badaix 2022-09-08 11:41:16 +02:00
parent d4bdbc3844
commit f5e75453ea
2 changed files with 13 additions and 17 deletions

View file

@ -54,18 +54,16 @@ template <typename Rep, typename Period>
void wait(boost::asio::steady_timer& timer, const std::chrono::duration<Rep, Period>& duration, std::function<void()> handler)
{
timer.expires_after(duration);
timer.async_wait(
[handler = std::move(handler)](const boost::system::error_code& ec)
timer.async_wait([handler = std::move(handler)](const boost::system::error_code& ec) {
if (ec)
{
if (ec)
{
LOG(ERROR, LOG_TAG) << "Error during async wait: " << ec.message() << "\n";
}
else
{
handler();
}
});
LOG(ERROR, LOG_TAG) << "Error during async wait: " << ec.message() << "\n";
}
else
{
handler();
}
});
}
} // namespace