Skip to content

Commit b79370a

Browse files
nickwongwongbinarywang
authored andcommitted
#324: 修复分布式刷新access_token冲突问题
1 parent 077e445 commit b79370a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceApacheHttpClientImpl.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,7 @@ public String getAccessToken(boolean forceRefresh) throws WxErrorException {
6565
Lock lock = this.getWxMpConfigStorage().getAccessTokenLock();
6666
try {
6767
lock.lock();
68-
69-
if (forceRefresh) {
70-
this.getWxMpConfigStorage().expireAccessToken();
71-
}
72-
73-
if (this.getWxMpConfigStorage().isAccessTokenExpired()) {
68+
if (this.getWxMpConfigStorage().isAccessTokenExpired() || forceRefresh) {
7469
String url = String.format(WxMpService.GET_ACCESS_TOKEN_URL,
7570
this.getWxMpConfigStorage().getAppId(), this.getWxMpConfigStorage().getSecret());
7671
try {

0 commit comments

Comments
 (0)