Commit 778ca87c by Johannes Edmeier

Merge branch '1.3.x'

parents 6ecb99e0 6b55c511
...@@ -20,6 +20,7 @@ import java.util.List; ...@@ -20,6 +20,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
...@@ -203,16 +204,18 @@ public class AdminServerWebConfiguration extends WebMvcConfigurerAdapter ...@@ -203,16 +204,18 @@ public class AdminServerWebConfiguration extends WebMvcConfigurerAdapter
@Bean @Bean
public ScheduledTaskRegistrar updateTaskRegistrar() { public ScheduledTaskRegistrar updateTaskRegistrar() {
ScheduledTaskRegistrar registrar = new ScheduledTaskRegistrar(); return new ScheduledTaskRegistrar();
}
registrar.addFixedRateTask(new Runnable() { @EventListener
public void onApplicationReadyEvent(ApplicationReadyEvent event) {
updateTaskRegistrar().addFixedRateTask(new Runnable() {
@Override @Override
public void run() { public void run() {
statusUpdater().updateStatusForAllApplications(); statusUpdater().updateStatusForAllApplications();
} }
}, adminServerProperties().getMonitor().getPeriod()); }, adminServerProperties().getMonitor().getPeriod());
updateTaskRegistrar().afterPropertiesSet();
return registrar;
} }
@Bean @Bean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment