szaszm commented on a change in pull request #1225: URL: https://github.com/apache/nifi-minifi-cpp/pull/1225#discussion_r767666348
########## File path: extensions/rocksdb-repos/FlowFileRepository.h ########## @@ -51,9 +51,9 @@ namespace repository { #define FLOWFILE_CHECKPOINT_DIRECTORY "./flowfile_checkpoint" #endif #define MAX_FLOWFILE_REPOSITORY_STORAGE_SIZE (10*1024*1024) // 10M -#define MAX_FLOWFILE_REPOSITORY_ENTRY_LIFE_TIME (600000) // 10 minute -#define FLOWFILE_REPOSITORY_PURGE_PERIOD (2000) // 2000 msec -#define FLOWFILE_REPOSITORY_RETRY_INTERVAL_INCREMENTS (500) // msec +constexpr std::chrono::milliseconds MAX_FLOWFILE_REPOSITORY_ENTRY_LIFE_TIME = std::chrono::minutes(10); +constexpr std::chrono::milliseconds FLOWFILE_REPOSITORY_PURGE_PERIOD = std::chrono::seconds(2); +constexpr std::chrono::milliseconds FLOWFILE_REPOSITORY_RETRY_INTERVAL_INCREMENTS = std::chrono::milliseconds(500); Review comment: Why convert them to milliseconds prematurely? I would prefer to keep their normal type and convert when it's actually needed. This happens to be the same behavior as with `auto`. ```suggestion using namespace std::literals; constexpr auto MAX_FLOWFILE_REPOSITORY_ENTRY_LIFE_TIME = 10min; constexpr auto FLOWFILE_REPOSITORY_PURGE_PERIOD = 2s; constexpr auto FLOWFILE_REPOSITORY_RETRY_INTERVAL_INCREMENTS = 500ms; ``` ########## File path: extensions/rocksdb-repos/ProvenanceRepository.h ########## @@ -38,8 +38,8 @@ namespace provenance { #define PROVENANCE_DIRECTORY "./provenance_repository" #define MAX_PROVENANCE_STORAGE_SIZE (10*1024*1024) // 10M -#define MAX_PROVENANCE_ENTRY_LIFE_TIME (60000) // 1 minute -#define PROVENANCE_PURGE_PERIOD (2500) // 2500 msec +constexpr std::chrono::milliseconds MAX_PROVENANCE_ENTRY_LIFE_TIME = std::chrono::minutes(1); +constexpr std::chrono::milliseconds PROVENANCE_PURGE_PERIOD = std::chrono::milliseconds(2500); Review comment: ```suggestion using namespace std::literals; constexpr auto MAX_PROVENANCE_ENTRY_LIFE_TIME = 1min; constexpr auto PROVENANCE_PURGE_PERIOD = 2500ms; ``` ########## File path: libminifi/include/core/Repository.h ########## @@ -56,17 +56,19 @@ namespace core { #define REPOSITORY_DIRECTORY "./repo" #define MAX_REPOSITORY_STORAGE_SIZE (10*1024*1024) // 10M -#define MAX_REPOSITORY_ENTRY_LIFE_TIME (600000) // 10 minute -#define REPOSITORY_PURGE_PERIOD (2500) // 2500 msec +constexpr std::chrono::milliseconds MAX_REPOSITORY_ENTRY_LIFE_TIME = std::chrono::minutes(10); +constexpr std::chrono::milliseconds REPOSITORY_PURGE_PERIOD = std::chrono::milliseconds(2500); Review comment: ```suggestion using namespace std::literals; constexpr auto MAX_REPOSITORY_ENTRY_LIFE_TIME = 10min; constexpr auto REPOSITORY_PURGE_PERIOD = 2500ms; ``` -- 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