protected void executeCustomStrategy(CommandContext commandContext, JobEntity job, ActivityImpl activity) throws Exception { FailedJobRetryConfiguration retryConfiguration = getFailedJobRetryConfiguration(job, activity); if (retryConfiguration == null) { executeStandardStrategy(commandContext); } else { if (isFirstJobExecution(job)) { // then change default retries to the ones configured initializeRetries(job, retryConfiguration.getRetries()); } else { LOG.debugDecrementingRetriesForJob(job.getId()); } List<String> intervals = retryConfiguration.getRetryIntervals(); int intervalsCount = intervals.size(); int indexOfInterval = Math.max(0, Math.min(intervalsCount - 1, intervalsCount - (job.getRetries() - 1))); DurationHelper durationHelper = getDurationHelper(intervals.get(indexOfInterval)); job.setLockExpirationTime(durationHelper.getDateAfter()); logException(job); decrementRetries(job); notifyAcquisition(commandContext); } }
protected void executeCustomStrategy(CommandContext commandContext, JobEntity job, ActivityImpl activity) throws Exception { FailedJobRetryConfiguration retryConfiguration = getFailedJobRetryConfiguration(job, activity); if (retryConfiguration == null) { executeStandardStrategy(commandContext); } else { if (isFirstJobExecution(job)) { // then change default retries to the ones configured initializeRetries(job, retryConfiguration.getRetries()); } else { LOG.debugDecrementingRetriesForJob(job.getId()); } List<String> intervals = retryConfiguration.getRetryIntervals(); int intervalsCount = intervals.size(); int indexOfInterval = Math.max(0, Math.min(intervalsCount - 1, intervalsCount - (job.getRetries() - 1))); DurationHelper durationHelper = getDurationHelper(intervals.get(indexOfInterval)); job.setLockExpirationTime(durationHelper.getDateAfter()); logException(job); decrementRetries(job); notifyAcquisition(commandContext); } }
protected void executeCustomStrategy(CommandContext commandContext, JobEntity job, ActivityImpl activity) throws Exception { FailedJobRetryConfiguration retryConfiguration = getFailedJobRetryConfiguration(job, activity); if (retryConfiguration == null) { executeStandardStrategy(commandContext); } else { if (isFirstJobExecution(job)) { // then change default retries to the ones configured initializeRetries(job, retryConfiguration.getRetries()); } else { LOG.debugDecrementingRetriesForJob(job.getId()); } List<String> intervals = retryConfiguration.getRetryIntervals(); int intervalsCount = intervals.size(); int indexOfInterval = Math.max(0, Math.min(intervalsCount - 1, intervalsCount - (job.getRetries() - 1))); DurationHelper durationHelper = getDurationHelper(intervals.get(indexOfInterval)); job.setLockExpirationTime(durationHelper.getDateAfter()); logException(job); decrementRetries(job); notifyAcquisition(commandContext); } }