martinzink commented on code in PR #1543:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1543#discussion_r1155847165


##########
libminifi/include/EventDrivenSchedulingAgent.h:
##########
@@ -38,11 +38,15 @@ class EventDrivenSchedulingAgent : public 
ThreadedSchedulingAgent {
                              std::shared_ptr<core::Repository> flow_repo, 
std::shared_ptr<core::ContentRepository> content_repo, 
std::shared_ptr<Configure> configuration,
                              utils::ThreadPool<utils::TaskRescheduleInfo> 
&thread_pool)
       : ThreadedSchedulingAgent(controller_service_provider, repo, flow_repo, 
content_repo, configuration, thread_pool) {
-    int slice = 
configuration->getInt(Configure::nifi_flow_engine_event_driven_time_slice, 
DEFAULT_TIME_SLICE_MS);
-    if (slice < 10 || 1000 < slice) {
+    using namespace std::literals::chrono_literals;
+
+    time_slice_ = 
configuration->get(Configure::nifi_flow_engine_event_driven_time_slice)
+        | 
utils::flatMap(utils::timeutils::StringToDuration<std::chrono::milliseconds>)
+        | utils::valueOrElse([] { return 
std::chrono::milliseconds(DEFAULT_TIME_SLICE_MS);});

Review Comment:
   good idea changed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1543/commits/64c5975e3fda0911820465778fa4d73f16d12002#diff-e8d87fb1392695bb61fc71860b0895a816856bc637825368c05d7f4031212c85R48-R49
 
https://github.com/apache/nifi-minifi-cpp/pull/1543/commits/64c5975e3fda0911820465778fa4d73f16d12002#diff-9d30d2ebf0518c2ec672054d681e45cbee06665a0c0eb377a44d0879f018dc53R26



-- 
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