adamdebreceni commented on code in PR #1519:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1519#discussion_r1124303823


##########
libminifi/src/core/ContentRepository.cpp:
##########
@@ -60,16 +60,29 @@ void ContentRepository::incrementStreamCount(const 
minifi::ResourceClaim &stream
   }
 }
 
+void ContentRepository::removeFromPurgeList() {
+  for (auto it = purge_list_.begin(); it != purge_list_.end();) {
+    if (removeKey(*it)) {
+      purge_list_.erase(it++);
+    } else {
+      ++it;
+    }
+  }
+}
+
 ContentRepository::StreamState ContentRepository::decrementStreamCount(const 
minifi::ResourceClaim &streamId) {
   std::lock_guard<std::mutex> lock(count_map_mutex_);
+  removeFromPurgeList();

Review Comment:
   I'm not sure either, I think it is good as it is now
   (later, if needed, we could move it to its own thread later or even 
integrate it into the planned async purge, we'll see)



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