diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java index c4e6609173..96cee20b1e 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java @@ -127,7 +127,7 @@ public class TimerDrivenSchedulingAgent implements SchedulingAgent { // after the yield has expired. final long newYieldExpiration = connectable.getYieldExpiration(); if (newYieldExpiration > System.currentTimeMillis()) { - final long yieldMillis = System.currentTimeMillis() - newYieldExpiration; + final long yieldMillis = newYieldExpiration - System.currentTimeMillis(); final ScheduledFuture scheduledFuture = futureRef.get(); if (scheduledFuture == null) { return;