Skip to content

Commit a15d8d7

Browse files
nickwongwongbinarywang
authored andcommitted
binarywang#324: 修复分布式刷新access_token冲突问题
1 parent 24fdf00 commit a15d8d7

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎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)