scheduler/src/main/java/com/cognitree/kronos/scheduler/TaskService.java
/**
     * check if retry is enabled on status {@param desiredStatus} for task {@param task}
     *
     * @param task
     * @param desiredStatus
     * @return
     */
check if retry is enabled on status  desiredStatus for task  task
@param task
@param desiredStatus
@return
check if retry is enabled on status desiredStatus for task task @param task @param desiredStatus @return
private boolean isRetryEnabled(Task task, Status desiredStatus) {
        /* Also ensure that the retry count is less than max retry count */
        Optional<Policy> retryPolicyOpt = task.getPolicies().stream()
                .filter(t -> t.getType() == Policy.Type.retry).findFirst();
        if (retryPolicyOpt.isPresent()) {
            RetryPolicy retryPolicy = (RetryPolicy) retryPolicyOpt.get();
            if ((desiredStatus == FAILED && retryPolicy.isRetryOnFailure())
                    || (desiredStatus == TIMED_OUT && retryPolicy.isRetryOnTimeout())) {
                int maxRetryCount = retryPolicy.getMaxRetryCount();
                return maxRetryCount > task.getRetryCount();
            }
            return false;
        }
        return false;
    }
private boolean isRetryEnabled ( Task task , Status desiredStatus ) { /* Also ensure that the retry count is less than max retry count */ Optional < Policy > retryPolicyOpt = task . getPolicies ( ) . stream ( ) . filter ( t -> t . getType ( ) == Policy . Type . retry ) . findFirst ( ) ; if ( retryPolicyOpt . isPresent ( ) ) { RetryPolicy retryPolicy = ( RetryPolicy ) retryPolicyOpt . get ( ) ; if ( ( desiredStatus == FAILED && retryPolicy . isRetryOnFailure ( ) ) || ( desiredStatus == TIMED_OUT && retryPolicy . isRetryOnTimeout ( ) ) ) { int maxRetryCount = retryPolicy . getMaxRetryCount ( ) ; return maxRetryCount > task . getRetryCount ( ) ; } return false ; } return false ; }
check if retry is enabled on status {@param desiredStatus} for task {@param task}
 @param task
 @param desiredStatus
 @return
check if retry is enabled on status { @param desiredStatus } for task { @param task } @param task @param desiredStatus @return