fgerlits commented on code in PR #2069:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2069#discussion_r2693970483
##########
libminifi/src/properties/Properties.cpp:
##########
@@ -199,59 +252,65 @@ void PropertiesImpl::loadConfigureFile(const
std::filesystem::path& configuratio
dirty_ = dirty_ || need_to_persist_new_value;
properties_[key] = {persisted_value, value, need_to_persist_new_value};
}
- checksum_calculator_.setFileLocation(properties_file_);
}
std::filesystem::path PropertiesImpl::getFilePath() const {
std::lock_guard<std::mutex> lock(mutex_);
- return properties_file_;
+ return base_properties_file_;
}
bool PropertiesImpl::commitChanges() {
std::lock_guard<std::mutex> lock(mutex_);
if (!dirty_) {
- logger_->log_info("Attempt to persist, but properties are not updated");
+ logger_->log_debug("commitChanges() called, but properties have not
changed, nothing to do");
return true;
}
- std::ifstream file(properties_file_, std::ifstream::in);
+ const auto output_file = (persist_to_ == PersistTo::SingleFile ?
base_properties_file_ : extra_properties_files_dir_name() /
C2PropertiesFileName);
Review Comment:
I have looked into it, but it would not be easy to do, because of the
complex inheritance structure:
<img width="300" height="200" alt="PropertiesImpl class"
src="https://github.com/user-attachments/assets/eed6440b-85e9-43d0-9e87-6c93e7e339b6"
/>
We would have to modify all these classes (maybe more), and also change 3
places in `C2Agent` where `commitChanges()` is called.
A simpler solution could be to find a more neutral name for this file, eg.
`90_runtime_updates.properties`. Would that be OK?
--
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]