mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-09-15 01:14:52 +00:00
优化:区分 HTTP 错误,返回明确原因 (#752)
* 优化:区分 HTTP 错误,返回明确原因 * 修复 缓存关闭共享的 client,会导致后续请求失败 * 修复 缓存关闭共享的 client,会导致后续请求失败 --------- Co-authored-by: 高雄 <admin@cxcp.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package cn.keking.utils;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import jakarta.annotation.PreDestroy;
|
||||
|
||||
@Component
|
||||
public class HttpClientLifecycle {
|
||||
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
System.out.println("Spring 容器关闭,释放 HTTP 连接池资源...");
|
||||
HttpRequestUtils.shutdown();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user