diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-02-21 20:39:54 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-02-21 20:47:16 +0100 |
commit | ba9f62de597311c3d763aa5a07f86f95b65ae266 (patch) | |
tree | b7afad6d1c5b6cfbc2c63d8d502917a6f034f9f0 | |
parent | 91d75605d62b4d0604cfb147f4b97863c9112157 (diff) |
Use duration_cast to handle steady clock and system clock having different
periods.
-rw-r--r-- | config/src/vespa/config/frt/frtconnection.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/config/src/vespa/config/frt/frtconnection.cpp b/config/src/vespa/config/frt/frtconnection.cpp index 93a5867b180..761129f259b 100644 --- a/config/src/vespa/config/frt/frtconnection.cpp +++ b/config/src/vespa/config/frt/frtconnection.cpp @@ -79,7 +79,7 @@ void FRTConnection::setSuccess() { _transientFailures = 0; _fatalFailures = 0; - _suspendedUntil = system_time(duration::zero()); + _suspendedUntil = system_time(); } void FRTConnection::calculateSuspension(ErrorType type) @@ -103,7 +103,7 @@ void FRTConnection::calculateSuspension(ErrorType type) break; } system_time now = system_clock::now(); - _suspendedUntil = now + delay; + _suspendedUntil = now + std::chrono::duration_cast<system_time::duration>(delay); if (_suspendWarned < (now - 5s)) { LOG(warning, "FRT Connection %s suspended until %s", _address.c_str(), vespalib::to_string(_suspendedUntil).c_str()); _suspendWarned = now; |