Fix running clusteraware scheduled tasks in Wildfly after legacy migration
As the parent class is in another module, the protected field "task" is not accessible from the lambda. Closes #13396
This commit is contained in:
parent
ec4b1c0158
commit
801b20e037
1 changed files with 3 additions and 1 deletions
|
@ -49,11 +49,13 @@ public class ClusterAwareScheduledTaskRunner extends ScheduledTaskRunner {
|
|||
ClusterProvider clusterProvider = session.getProvider(ClusterProvider.class);
|
||||
String taskKey = task.getClass().getSimpleName();
|
||||
|
||||
// copying over the value as parent class is in another module that wouldn't allow access from the lambda in Wildfly
|
||||
ScheduledTask localTask = this.task;
|
||||
ExecutionResult<Void> result = clusterProvider.executeIfNotExecuted(taskKey, intervalSecs, new Callable<Void>() {
|
||||
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
task.run(session);
|
||||
localTask.run(session);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue