fgerlits commented on a change in pull request #1064:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1064#discussion_r629371159



##########
File path: extensions/standard-processors/processors/GetFile.cpp
##########
@@ -159,47 +148,54 @@ void GetFile::onSchedule(core::ProcessContext *context, 
core::ProcessSessionFact
 }
 
 void GetFile::onTrigger(core::ProcessContext* /*context*/, 
core::ProcessSession *session) {
-  // Perform directory list
-
   metrics_->iterations_++;
 
-  const bool isDirEmptyBeforePoll = isListingEmpty();
-  logger_->log_debug("Is listing empty before polling directory %i", 
isDirEmptyBeforePoll);
-  if (isDirEmptyBeforePoll) {
+  const bool is_dir_empty_before_poll = isListingEmpty();
+  logger_->log_debug("Listing is %s before polling directory", 
is_dir_empty_before_poll ? "empty" : "not empty");
+  if (is_dir_empty_before_poll) {
     if (request_.pollInterval == 0 || (utils::timeutils::getTimeMillis() - 
last_listing_time_) > request_.pollInterval) {
       performListing(request_);
       last_listing_time_.store(utils::timeutils::getTimeMillis());
     }
   }
 
-  const bool isDirEmptyAfterPoll = isListingEmpty();
-  logger_->log_debug("Is listing empty after polling directory %i", 
isDirEmptyAfterPoll);
+  const bool is_dir_empty_after_poll = isListingEmpty();
+  logger_->log_debug("Listing is %s after polling directory", 
is_dir_empty_after_poll ? "empty" : "not empty");
+  if (is_dir_empty_after_poll) {
+    yield();
+    return;
+  }
+
+  std::queue<std::string> list_of_file_names = pollListing(request_.batchSize);
+  while (!list_of_file_names.empty()) {

Review comment:
       done in 
https://github.com/apache/nifi-minifi-cpp/pull/1064/commits/3a154cc5756502d6b20e953b6eb31edd157d7e78




-- 
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:
us...@infra.apache.org


Reply via email to