arpadboda commented on a change in pull request #721: MINIFICPP-1135 - Add a
watchdog to schedulingAgent to warn in case of…
URL: https://github.com/apache/nifi-minifi-cpp/pull/721#discussion_r373458980
##########
File path: libminifi/include/SchedulingAgent.h
##########
@@ -131,11 +136,16 @@ class SchedulingAgent {
auto pool = utils::ThreadPool<uint64_t>(csThreads, false,
controller_service_provider, "SchedulingAgent");
thread_pool_ = std::move(pool);
thread_pool_.start();
+
+ std::function<void(void)> f = std::bind(&SchedulingAgent::watchDogFunc,
this);
+ watchDogTimer_.reset(new
utils::CallBackTimer(std::chrono::milliseconds(SCHEDULING_WATCHDOG_CHECK_PERIOD),
f));
+ watchDogTimer_->start();
}
// Destructor
virtual ~SchedulingAgent() {
-
+ watchDogTimer_->stop();
Review comment:
I had to put the stop call back to the dtor, added a comment there to make
sure.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services