diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-02-22 19:42:47 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-02-22 19:42:47 +0100 |
commit | 76a889dc0837a7ccaf3e869ca64b111d4a0ecc70 (patch) | |
tree | 5cf3a22f1415df4d86a77c56f1147a3021ed8269 /config | |
parent | ba9f62de597311c3d763aa5a07f86f95b65ae266 (diff) |
Add comment about why duration_cast is needed.
Diffstat (limited to 'config')
-rw-r--r-- | config/src/vespa/config/frt/frtconnection.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/config/src/vespa/config/frt/frtconnection.cpp b/config/src/vespa/config/frt/frtconnection.cpp index 761129f259b..6eb71eb18f0 100644 --- a/config/src/vespa/config/frt/frtconnection.cpp +++ b/config/src/vespa/config/frt/frtconnection.cpp @@ -103,6 +103,12 @@ void FRTConnection::calculateSuspension(ErrorType type) break; } system_time now = system_clock::now(); + /* + * On Darwin, the std::chrono::steady_clock period (std::nano) is + * not exactly divisible by the std::chrono::system_clock period + * (std::micro). Thus we need to use std::chrono::duration_cast to + * convert from steady_time::duration to system_time::duration. + */ _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()); |