feat remove debug log from timer
All checks were successful
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 44s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 52s

This commit is contained in:
tqcq 2024-03-16 16:12:13 +08:00
parent 122172f297
commit 193826df35

View File

@ -3,9 +3,8 @@
#include "sled/units/time_delta.h"
namespace sled {
TaskQueueTimeoutFactory::TaskQueueTimeout::TaskQueueTimeout(
TaskQueueTimeoutFactory &parent,
sled::TaskQueueBase::DelayPrecision precision)
TaskQueueTimeoutFactory::TaskQueueTimeout::TaskQueueTimeout(TaskQueueTimeoutFactory &parent,
sled::TaskQueueBase::DelayPrecision precision)
: parent_(parent),
precision_(precision)
{}
@ -13,8 +12,7 @@ TaskQueueTimeoutFactory::TaskQueueTimeout::TaskQueueTimeout(
TaskQueueTimeoutFactory::TaskQueueTimeout::~TaskQueueTimeout() {}
void
TaskQueueTimeoutFactory::TaskQueueTimeout::Start(DurationMs duration_ms,
TimeoutID timeout_id)
TaskQueueTimeoutFactory::TaskQueueTimeout::Start(DurationMs duration_ms, TimeoutID timeout_id)
{
ASSERT(timeout_expiration_ == std::numeric_limits<TimeMs>::max(), "");
timeout_expiration_ = parent_.get_time_() + duration_ms;
@ -32,9 +30,7 @@ TaskQueueTimeoutFactory::TaskQueueTimeout::Start(DurationMs duration_ms,
precision_,
[timeout_id, this]() {
LOGV("timer", "Timeout expired: {}", timeout_id);
ASSERT(posted_task_expiration_
!= std::numeric_limits<TimeMs>::max(),
"");
ASSERT(posted_task_expiration_ != std::numeric_limits<TimeMs>::max(), "");
posted_task_expiration_ = std::numeric_limits<TimeMs>::max();
if (timeout_expiration_ == std::numeric_limits<TimeMs>::max()) {
@ -44,7 +40,7 @@ TaskQueueTimeoutFactory::TaskQueueTimeout::Start(DurationMs duration_ms,
const TimeMs now = parent_.get_time_();
if (timeout_expiration_ <= now) {
timeout_expiration_ = std::numeric_limits<TimeMs>::max();
LOGD("timer", "Timeout Triggered: {}", timeout_id);
LOGV("timer", "Timeout Triggered: {}", timeout_id);
parent_.on_expired_(timeout_id_);
} else {
const DurationMs remaining = timeout_expiration_ - now;