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

Update default_access_token.go #805

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

yangyl12345
Copy link
Contributor

微信获取稳定版token,只有不等于空字符串的情况下才会返回access_token信息,未空的情况,继续调去微信服务

微信获取稳定版token,只有不等于空字符串的情况下才会返回access_token信息,未空的情况,继续调去微信服务
@yangyl12345 yangyl12345 marked this pull request as draft November 25, 2024 14:25
@yangyl12345 yangyl12345 marked this pull request as ready for review November 25, 2024 14:25
@yangyl12345
Copy link
Contributor Author

#804 修复问题

@houseme
Copy link
Collaborator

houseme commented Nov 26, 2024

建议进一步完善一下,把锁加一下,按照66L的函数方式完整处理一下,加锁,二次处理等

// 加上lock,是为了防止在并发获取token时,cache刚好失效,导致从微信服务器上获取到不同token
	ak.accessTokenLock.Lock()
	defer ak.accessTokenLock.Unlock()

@yangyl12345
Copy link
Contributor Author

#804 微信稳定性获取 access_token 接口,添加防止并发性获取 access_token 和多次微信服务获取代码

@houseme houseme merged commit a571bf3 into silenceper:v2 Nov 26, 2024
13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants