You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/10/26 13:54:03 UTC

[brooklyn-server] branch master updated: revert PR suggestion to schedule task done check

This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git


The following commit(s) were added to refs/heads/master by this push:
     new 0416776  revert PR suggestion to schedule task done check
0416776 is described below

commit 0416776580c771471f4744c498a2e2c3caee5ad8
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Tue Oct 26 14:53:11 2021 +0100

    revert PR suggestion to schedule task done check
    
    was correct as was, done is implied by runCount > maxIterations
---
 .../src/main/java/org/apache/brooklyn/util/core/task/ScheduledTask.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/brooklyn/util/core/task/ScheduledTask.java b/core/src/main/java/org/apache/brooklyn/util/core/task/ScheduledTask.java
index 8de5f11..2c07fa7 100644
--- a/core/src/main/java/org/apache/brooklyn/util/core/task/ScheduledTask.java
+++ b/core/src/main/java/org/apache/brooklyn/util/core/task/ScheduledTask.java
@@ -231,7 +231,7 @@ public class ScheduledTask extends BasicTask<Object> {
     
     @Override
     public boolean isDone(boolean andTaskNoLongerRunning) {
-        boolean done = isCancelled() || (maxIterations!=null && maxIterations > runCount) || (period==null && nextRun!=null && nextRun.isDone());
+        boolean done = isCancelled() || (maxIterations!=null && maxIterations <= runCount) || (period==null && nextRun!=null && nextRun.isDone());
         if (andTaskNoLongerRunning) {
             return done && super.isDone(true);
         } else {