Update aixlog to v1.2.5

This commit is contained in:
badaix 2020-01-10 23:05:04 +01:00
parent cd9f785425
commit 52af69618c
2 changed files with 9 additions and 3 deletions

View file

@ -17,9 +17,13 @@
***/
#include "watchdog.hpp"
#include "common/aixlog.hpp"
#include <chrono>
static constexpr auto LOG_TAG = "Watchdog";
using namespace std;
namespace streamreader
@ -38,6 +42,7 @@ Watchdog::~Watchdog()
void Watchdog::start(const std::chrono::milliseconds& timeout)
{
LOG(INFO, LOG_TAG) << "Starting watchdog, timeout: " << std::chrono::duration_cast<std::chrono::seconds>(timeout).count() << "s\n";
timeout_ms_ = timeout;
trigger();
}
@ -56,6 +61,7 @@ void Watchdog::trigger()
timer_.async_wait([this](const boost::system::error_code& ec) {
if (!ec)
{
LOG(INFO, LOG_TAG) << "Timed out: " << std::chrono::duration_cast<std::chrono::seconds>(timeout_ms_).count() << "s\n";
listener_->onTimeout(*this, timeout_ms_);
}
});