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

微信AccessToken被动更新可能会有并发更新的情况出现 #390

Closed
eastonqiu opened this issue Apr 13, 2016 · 3 comments
Closed

Comments

@eastonqiu
Copy link

我用的环境

PHP 版本:5.3
overtrue/wechat 版本:最新

问题及现象

微信AccessToken被动更新可能会有并发更新的情况出现,代码实现中没有做保护
如果有两个请求同时请求并被动更新access token,此时两个请求获得的access token将不同,
弱弱地问下这算bug吗,如何解决,谢谢~

描述你的问题现象,报错贴截图粘贴或者贴具体信息,提供必要的代码段

@overtrue
Copy link
Collaborator

@eastonqiu 并发更新这个问题的话,实际上很难避免,当然你可以用redis做存储的话应该机率小很多。

@eastonqiu
Copy link
Author

@overtrue 用redis和用普通的文件或数据库存储对于access token并发更新这种场景会有什么不同吗,谢谢~

@overtrue
Copy link
Collaborator

@eastonqiu 存取会快些啊,就降低了单个进程所耗费的时间。

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

No branches or pull requests

2 participants