From 96c0022c54362d78ce0446f112aeda64fd320164 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 21 Dec 2020 16:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=98=E9=9B=85=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/config/shutdown/GracefulShutdownTomcat.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java index 0e3442b5a6..58ac781efe 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java @@ -4,6 +4,7 @@ import org.apache.catalina.connector.Connector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; import org.springframework.context.ApplicationListener; @@ -16,6 +17,7 @@ import java.util.concurrent.TimeUnit; @EnableConfigurationProperties(ShutdownProperties.class) @Component +@ConditionalOnProperty(prefix = "shutdown.graceful", name = "enable", havingValue = "true", matchIfMissing = false) public class GracefulShutdownTomcat implements TomcatConnectorCustomizer, ApplicationListener { private static final Logger logger = LoggerFactory.getLogger(GracefulShutdownTomcat.class);