martinzink commented on a change in pull request #1225:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1225#discussion_r785809334



##########
File path: libminifi/include/utils/TimeUtil.h
##########
@@ -197,6 +193,106 @@ inline bool getDateTimeStr(int64_t unix_timestamp, 
std::string& date_time_str) {
   return true;
 }
 
+namespace details {
+
+template<class Duration>
+bool unit_matches(const std::string&) {
+  return false;
+}
+
+template<>
+inline bool unit_matches<std::chrono::nanoseconds>(const std::string& unit) {
+  return unit == "ns" || unit == "nano" || unit == "nanos" || unit == 
"nanoseconds";

Review comment:
       sure thing, 
https://github.com/apache/nifi-minifi-cpp/pull/1225/commits/80ebd14a79cbffc9287b7a8c260abe3510db4d74#diff-3f1741daa1a9506c6303aeb6642d79146ec5ee6ee9469a2b04c4cf73a2ffd50dR165

##########
File path: libminifi/include/sitetosite/Peer.h
##########
@@ -155,12 +158,11 @@ class SiteToSitePeer : public 
org::apache::nifi::minifi::io::BaseStream {
       : stream_(nullptr),
         host_(host),
         port_(port),
-        timeout_(30000),
-        yield_expiration_(0),
+        timeout_(std::chrono::seconds(30)),
         logger_(core::logging::LoggerFactory<SiteToSitePeer>::getLogger()) {
     url_ = "nifi://" + host_ + ":" + std::to_string(port_);
-    yield_expiration_ = 0;
-    timeout_ = 30000;  // 30 seconds
+    yield_expiration_ = std::chrono::system_clock::time_point();
+    timeout_ = std::chrono::seconds(30);  // 30 seconds

Review comment:
       fixed 
https://github.com/apache/nifi-minifi-cpp/pull/1225/commits/80ebd14a79cbffc9287b7a8c260abe3510db4d74#diff-3f1741daa1a9506c6303aeb6642d79146ec5ee6ee9469a2b04c4cf73a2ffd50dR165

##########
File path: libminifi/include/core/ProcessorConfig.h
##########
@@ -32,8 +32,8 @@ namespace core {
 
 #define DEFAULT_SCHEDULING_STRATEGY "TIMER_DRIVEN"
 #define DEFAULT_SCHEDULING_PERIOD_STR "1 sec"
-#define DEFAULT_SCHEDULING_PERIOD_MILLIS 1000
-#define DEFAULT_RUN_DURATION 0
+constexpr std::chrono::milliseconds DEFAULT_SCHEDULING_PERIOD_MILLIS{1000};
+constexpr std::chrono::nanoseconds DEFAULT_RUN_DURATION{0};
 #define DEFAULT_MAX_CONCURRENT_TASKS 1
 #define DEFAULT_YIELD_PERIOD_SECONDS 1

Review comment:
       :+1:  done 
https://github.com/apache/nifi-minifi-cpp/pull/1225/commits/80ebd14a79cbffc9287b7a8c260abe3510db4d74#diff-f2a42efc99a3aa3a32fef6dc7b543b9d6181889937b4c368070753700a7b5cc5R38

##########
File path: extensions/windows-event-log/CollectorInitiatedSubscription.cpp
##########
@@ -39,6 +39,8 @@
 #pragma comment(lib, "wevtapi.lib")
 #pragma comment(lib, "Wecapi.lib")
 
+using namespace std::chrono_literals;  // NOLINT(build/namespaces)

Review comment:
       good idea, changed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1225/commits/80ebd14a79cbffc9287b7a8c260abe3510db4d74#diff-d3b46e6cb41aa26d0fa4816a424dd9c3de38244da6918403333e0192906b5b9aR35




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to