This commit is contained in:
lu7213 committed 2026-08-13 02:47:05 -04:00
1 parent f0b438eb6c
commit 77557ce4af
1 file changed
+7 -1
@@ -59,7 +59,7 @@ public class HttpHelper {
public void setProxyPort(Integer proxyPort) { public void setProxyPort(Integer proxyPort) {
this.proxyPort = proxyPort; this.proxyPort = proxyPort;
} }
public void closeClient(){ public synchronized void closeClient(){
try { try {
if (httpsClient != null) { if (httpsClient != null) {
httpsClient.close(); httpsClient.close();
@@ -72,6 +72,12 @@ public class HttpHelper {
}catch (Exception e){ }catch (Exception e){
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
} }
if (cm != null) {
cm.close();
}
cm = new PoolingHttpClientConnectionManager();
cm.setMaxTotal(500);
cm.setDefaultMaxPerRoute(5);
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
BigDecimal decimal = new BigDecimal("1").divide(new BigDecimal(100)); BigDecimal decimal = new BigDecimal("1").divide(new BigDecimal(100));