bug-fix: throwable param's required for @FailedTask annotated methods

Lack of this parameter causes:
-  the exception with message: "o.s.c.t.listener.TaskLifecycleListener: taskExecution and throwable parameters are required for @FailedTask annotated methods :While handling this error: java.lang.IllegalStateException: Failed to execute ApplicationRunner" - please, take look at [this](https://github.com/spring-cloud/spring-cloud-task/blob/master/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/listener/annotation/TaskListenerExecutor.java#L113)
- and, as a consequence, a lost lock on the task (record in the table `task_locks`)
This commit is contained in:
wildloop
2018-12-03 17:23:49 +01:00
committed by Glenn Renfro
parent da56c2b08e
commit b4b50e8182

View File

@@ -128,7 +128,7 @@ public class SingleInstanceTaskListener implements ApplicationListener<Applicati
}
@FailedTask
public void unlockTaskOnError(TaskExecution taskExecution) throws Exception {
public void unlockTaskOnError(TaskExecution taskExecution, Throwable throwable) throws Exception {
this.lockRegistryLeaderInitiator.destroy();
}