You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "mattyb149 (via GitHub)" <gi...@apache.org> on 2023/09/05 18:54:49 UTC
[GitHub] [nifi] mattyb149 commented on a diff in pull request #7664: NIFI-12019 bugfix for SynchronousFileWatcher time check interval
mattyb149 commented on code in PR #7664:
URL: https://github.com/apache/nifi/pull/7664#discussion_r1316278797
##########
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/file/monitor/SynchronousFileWatcher.java:
##########
@@ -77,21 +77,16 @@ public boolean checkAndReset() throws IOException {
private boolean checkForUpdate() throws IOException {
if (resourceLock.tryLock()) {
try {
- final StateWrapper wrapper = lastState.get();
+ final Object oldState = lastState.get().getState();
final Object newState = monitor.getCurrentState(path);
- if (newState == null && wrapper.getState() == null) {
+ if (newState == null && oldState == null) {
return false;
}
- if (newState == null || wrapper.getState() == null) {
- lastState.set(new StateWrapper(newState));
+ lastState.set(new StateWrapper(newState));
Review Comment:
If newState is `null` does this cause issues creating a wrapper around it?
--
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-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org