adamdebreceni commented on a change in pull request #1225: URL: https://github.com/apache/nifi-minifi-cpp/pull/1225#discussion_r768570039
########## File path: libminifi/src/RemoteProcessorGroupPort.cpp ########## @@ -167,17 +167,12 @@ void RemoteProcessorGroupPort::onSchedule(const std::shared_ptr<core::ProcessCon } } { - uint64_t idleTimeoutVal = 15000; - std::string idleTimeoutStr; - if (!context->getProperty(idleTimeout.getName(), idleTimeoutStr) - || !core::Property::getTimeMSFromString(idleTimeoutStr, idleTimeoutVal)) { - logger_->log_debug("%s attribute is invalid, so default value of %s will be used", idleTimeout.getName(), - idleTimeout.getValue()); - if (!core::Property::getTimeMSFromString(idleTimeout.getValue(), idleTimeoutVal)) { - assert(false); // Couldn't parse our default value - } + if (auto idle_timeout = context->getProperty<core::TimePeriodValue>(idleTimeout)) { + idle_timeout_ = idle_timeout->getMilliseconds(); + } else { + logger_->log_debug("%s attribute is invalid, so default value of %s will be used", idleTimeout.getName(), idleTimeout.getDefaultValue()); + idle_timeout_ = static_cast<core::TimePeriodValue>(idleTimeout.getDefaultValue().to_string()).getMilliseconds(); Review comment: this `static_cast` feels "off", although at a glance I couldn't find anything in the coding guidelines that would advise against it, might even advises for it: > Use static_cast as the equivalent of a C-style cast that does value conversion -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org