Skip to content

Commit

Permalink
#324: 修复分布式刷新access_token冲突问题
Browse files Browse the repository at this point in the history
  • Loading branch information
nickwongwong authored and binarywang committed Sep 2, 2017
1 parent 077e445 commit b79370a
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ public String getAccessToken(boolean forceRefresh) throws WxErrorException {
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 {
Expand Down

0 comments on commit b79370a

Please sign in to comment.