lordgamez commented on a change in pull request #1090:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1090#discussion_r663918197



##########
File path: libminifi/test/TestBase.h
##########
@@ -445,6 +445,13 @@ class TestController {
     return dir;
   }
 
+  template<size_t N>
+  utils::Path createTempDirectory(const char (&format)[N]) {

Review comment:
       This simplifies things a bit :+1: 

##########
File path: extensions/rocksdb-repos/FlowFileRepository.cpp
##########
@@ -220,17 +240,21 @@ void FlowFileRepository::initialize_repository() {
     logger_->log_trace("Do not need checkpoint");
     return;
   }
-  rocksdb::Checkpoint *checkpoint;
   // delete any previous copy
-  if (utils::file::FileUtils::delete_dir(checkpoint_dir_) >= 0 && 
opendb->NewCheckpoint(&checkpoint).ok()) {
-    if (checkpoint->CreateCheckpoint(checkpoint_dir_).ok()) {
+  if (utils::file::FileUtils::delete_dir(checkpoint_dir_) >= 0) {
+    rocksdb::Checkpoint* checkpoint = nullptr;
+    rocksdb::Status checkpoint_status = opendb->NewCheckpoint(&checkpoint);
+    if (checkpoint_status.ok()) {
+      checkpoint_status = checkpoint->CreateCheckpoint(checkpoint_dir_);

Review comment:
       I may go with an early return and a separate error message here, just to 
know which call failed in case of failure.

##########
File path: libminifi/test/TestBase.h
##########
@@ -445,6 +445,13 @@ class TestController {
     return dir;
   }
 
+  template<size_t N>
+  utils::Path createTempDirectory(const char (&format)[N]) {

Review comment:
       Yes I thought the same, it should definitely be in a separate PR.




-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to