Fix time_delta<seconds> formatting in milliseconds

The time_delta<T> was using the wrong duration type when formatting, so
was outputting millisecond precision in the systemd status string which
is pointless (and unintended).
pull/2039/head
Jason Rhinelander 2 years ago
parent 9f10e8003e
commit 67e002c8ee
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262

@ -42,7 +42,7 @@ namespace fmt
format(const llarp::time_delta<Time_Duration>& td, FormatContext& ctx)
{
const auto dlt =
std::chrono::duration_cast<llarp::Duration_t>(llarp::TimePoint_t::clock::now() - td.at);
std::chrono::duration_cast<Time_Duration>(llarp::TimePoint_t::clock::now() - td.at);
using Parent = formatter<std::string>;
if (dlt > 0s)
return Parent::format(fmt::format("{} ago", dlt), ctx);

Loading…
Cancel
Save