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


##########
libminifi/src/c2/C2Agent.cpp:
##########
@@ -627,19 +628,21 @@ void C2Agent::handlePropertyUpdate(const 
C2ContentResponse &resp) {
     changeUpdateState(update_property(entry.first, entry.second.to_string(), 
lifetime));
   }
   // apply changes and persist properties requested to be persisted
-  if (result != state::UpdateState::NO_OPERATION && 
!configuration_->commitChanges()) {
+  auto propertyWasUpdated = [&](){ return result == 
state::UpdateState::FULLY_APPLIED || result == 
state::UpdateState::PARTIALLY_APPLIED; };

Review Comment:
   if `propertyWasUpdated()` returns `false` at first, then line 633 won't run 
and the result remains `false`, if it returns `true` at first and the commit 
fails, line 633 sets it to `PARTIALLY_APPLIED` which keeps its result `true`



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