Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.7.0版本小程序,刷新token,lock之后,里面没有再去获取下token,导致后续阻塞的线程又刷了 #1554

Closed
hongmozhuwei opened this issue May 9, 2020 · 3 comments

Comments

@hongmozhuwei
Copy link

简要描述

3.7.0版本小程序,刷新token,lock之后,里面没有再去获取下token。

模块版本情况

  • WxJava 模块名: weixin-java-miniapp
  • WxJava 版本号: 3.7.0

详细描述

WxMaServiceImpl类中getAccessToken方法, lock.lock()之后,没有再去获取下token,高并发情况下,导致后续的线程覆盖刷新

@binarywang
Copy link
Owner

建议看下官方文档:公众平台后台会保证在5分钟内,新老 access_token 都可用
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html

@binarywang
Copy link
Owner

不过可以考虑加上重新读取最新token的逻辑,避免多次刷新token

@binarywang
Copy link
Owner

3.7.9.B版本已优化

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants