You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TaskJobLauncherCommandLineRunner now inherits from JobLauncherCommandLineRunner
Used to be a copy of. No just inherits.
Added feature check for completed/failed jobs before throwing exception
Currently in Task if the user sets failOnJobFailure and they are using a TaskExecutor it will not throw an exception when task fails.
This because at evaluation time the job has not started.
With the latest change Task waits for all jobs to complete before deciding whether an exception needs to be thrown or not.
Copy file name to clipboardExpand all lines: spring-cloud-task-batch/src/main/java/org/springframework/cloud/task/batch/configuration/TaskBatchProperties.java
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,21 @@ public class TaskBatchProperties {
43
43
*/
44
44
privateintcommandLineRunnerOrder = 0;
45
45
46
+
/**
47
+
* Maximum wait time that Spring Cloud task will wait for tasks to complete
48
+
* when spring.cloud.task.batch.failOnJobFailure is set to true. Defaults
49
+
* to 0. 0 indicates no wait time is enforced.
50
+
*/
51
+
privatelongfailOnJobFailurewaitTimeInMillis = 0;
52
+
53
+
/**
54
+
* Fixed delay that Spring Cloud Task will wait when checking if
55
+
* {@link org.springframework.batch.core.JobExecution}s have completed,
56
+
* when spring.cloud.task.batch.failOnJobFailure is set to true. Defaults
Copy file name to clipboardExpand all lines: spring-cloud-task-batch/src/main/java/org/springframework/cloud/task/batch/configuration/TaskJobLauncherAutoConfiguration.java
Copy file name to clipboardExpand all lines: spring-cloud-task-batch/src/main/java/org/springframework/cloud/task/batch/configuration/TaskJobLauncherCommandLineRunnerFactoryBean.java
+48-1Lines changed: 48 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,21 @@ public class TaskJobLauncherCommandLineRunnerFactoryBean implements FactoryBean<
46
46
47
47
privateIntegerorder = 0;
48
48
49
+
/**
50
+
* Maximum wait time that Spring Cloud task will wait for tasks to complete
51
+
* when spring.cloud.task.batch.failOnJobFailure is set to true. Defaults
52
+
* to 0. 0 indicates no wait time is enforced.
53
+
*/
54
+
privatelongfailOnJobFailurewaitTimeInMillis = 0;
55
+
56
+
/**
57
+
* Fixed delay that Spring Cloud Task will wait when checking if
58
+
* {@link org.springframework.batch.core.JobExecution}s have completed,
59
+
* when spring.cloud.task.batch.failOnJobFailure is set to true. Defaults
0 commit comments