#324: 修复分布式刷新access_token冲突问题

This commit is contained in:
Nick Wong
2017-09-03 00:00:58 +08:00
committed by Binary Wang
parent 077e44534c
commit b79370ac60
@@ -65,12 +65,7 @@ public class WxMpServiceApacheHttpClientImpl extends WxMpServiceAbstractImpl<Clo
Lock lock = this.getWxMpConfigStorage().getAccessTokenLock();
try {
lock.lock();
if (forceRefresh) {
this.getWxMpConfigStorage().expireAccessToken();
}
if (this.getWxMpConfigStorage().isAccessTokenExpired()) {
if (this.getWxMpConfigStorage().isAccessTokenExpired() || forceRefresh) {
String url = String.format(WxMpService.GET_ACCESS_TOKEN_URL,
this.getWxMpConfigStorage().getAppId(), this.getWxMpConfigStorage().getSecret());
try {