You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "dan-s1 (via GitHub)" <gi...@apache.org> on 2023/12/15 14:23:01 UTC

Re: [PR] NIFI-12402 add option to user can avoid an inactive indicator is crea… [nifi]

dan-s1 commented on code in PR #8063:
URL: https://github.com/apache/nifi/pull/8063#discussion_r1428029603


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MonitorActivity.java:
##########
@@ -300,7 +312,11 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
 
             if (isInactive) {
                 final boolean continual = context.getProperty(CONTINUALLY_SEND_MESSAGES).asBoolean();
-                sendInactiveMarker = !inactive.getAndSet(true) || (continual && (now > lastInactiveMessage.get() + thresholdMillis));
+                if (!initialInactivityIndicator) {
+                    sendInactiveMarker = (!inactive.getAndSet(true) || (continual && (now > lastInactiveMessage.get() + thresholdMillis))) && hasSuccessTransfer.get();
+                } else {
+                    sendInactiveMarker = !inactive.getAndSet(true) || (continual && (now > lastInactiveMessage.get() + thresholdMillis));
+                }

Review Comment:
   `!inactive.getAndSet(true) || (continual && (now > lastInactiveMessage.get()` is common code between lines 316 and 318. Can you please assign this to a variable whose name should describe what these conditions are and then use the variable on lines 316 and 318? Thanks!



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