Browse Source

#384 去掉executeInternal上会导致性能问题的同步代码synchronized

master
axeon 7 years ago
committed by Binary Wang
parent
commit
920a2f7e13
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceAbstractImpl.java
  2. +1
    -1
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaServiceImpl.java
  3. +1
    -1
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceAbstractImpl.java

+ 1
- 1
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceAbstractImpl.java View File

@@ -381,7 +381,7 @@ public abstract class WxCpServiceAbstractImpl<H, P> implements WxCpService, Requ
throw new RuntimeException("微信服务端异常,超出重试次数"); throw new RuntimeException("微信服务端异常,超出重试次数");
} }


protected synchronized <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
if (uri.contains("access_token=")) { if (uri.contains("access_token=")) {
throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri); throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri);
} }


+ 1
- 1
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaServiceImpl.java View File

@@ -181,7 +181,7 @@ public class WxMaServiceImpl implements WxMaService, RequestHttp<CloseableHttpCl
throw new RuntimeException("微信服务端异常,超出重试次数"); throw new RuntimeException("微信服务端异常,超出重试次数");
} }


public synchronized <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
public <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
if (uri.contains("access_token=")) { if (uri.contains("access_token=")) {
throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri); throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri);
} }


+ 1
- 1
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceAbstractImpl.java View File

@@ -259,7 +259,7 @@ public abstract class WxMpServiceAbstractImpl<H, P> implements WxMpService, Requ
throw new RuntimeException("微信服务端异常,超出重试次数"); throw new RuntimeException("微信服务端异常,超出重试次数");
} }


public synchronized <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
public <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
if (uri.contains("access_token=")) { if (uri.contains("access_token=")) {
throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri); throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri);
} }


Loading…
Cancel
Save