Merge pull request #440 from Haybu/bug/bean-refresh-1.0.x

restart endpoint does not need to be enabled when refresh is used by …
This commit is contained in:
Haytham Mohamed
2019-09-25 16:27:11 -05:00
committed by GitHub

View File

@@ -38,6 +38,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.AbstractEnvironment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.util.Assert;
/**
* Definition of beans needed for the automatic reload of configuration.
@@ -110,9 +111,11 @@ public class ConfigReloadAutoConfiguration {
@ConditionalOnMissingBean
public ConfigurationUpdateStrategy configurationUpdateStrategy(
ConfigReloadProperties properties, ConfigurableApplicationContext ctx,
RestartEndpoint restarter, ContextRefresher refresher) {
@Autowired(required = false) RestartEndpoint restarter,
ContextRefresher refresher) {
switch (properties.getStrategy()) {
case RESTART_CONTEXT:
Assert.notNull(restarter, "Restart endpoint is not enabled");
return new ConfigurationUpdateStrategy(properties.getStrategy().name(),
restarter::restart);
case REFRESH: