Grails3/4 tomcat直接关闭(Shutdown),数据库连接并未销毁解决办法

由于Grails3/4使用的spring boot,spring boot自带shutdown机制,在application.yml配置中添加如下配置:

endpoints:
    shutdown:
        # 启用shutdown
        enabled: true
        # 禁用密码验证
        sensitive: false

这里需要注意,请求类型必须是post方式

curl -X POST host:port/shutdown

发布了102 篇原创文章 · 获赞 40 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/qq_16165281/article/details/104987629