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

add: Go版新增图片类型的推送消息 #30

Merged
merged 2 commits into from
Aug 19, 2021
Merged

Conversation

fcbhank
Copy link
Contributor

@fcbhank fcbhank commented Aug 17, 2021

具体工作(go-wecomchan):

  1. 兼容原文本消息推送接口,新增支持推送图片消息,并直接返回企业微信的response json串,原先接口无返回数据
  2. 调整redis缓存机制,原先可能存在access_token已失效,但仍然存在于redis中并被使用,导致报错
  3. Dockerfile中新增一行用于替换alpinelinux的国内源
  4. 相应调增README.md内容

@fcbhank
Copy link
Contributor Author

fcbhank commented Aug 17, 2021

@easychen

@easychen
Copy link
Owner

easychen commented Aug 17, 2021

@AceAttorney 同学帮忙review下吧,确定 merge 的话在评论里 at 我下,多谢啦

@AceAttorney
Copy link
Contributor

@easychen 确认合并 @fcbhank 感谢贡献,看了一下请求前再次刷新access_token的方法,还是有可能不能覆盖一部分token过期场景,目前来看企业微信有时会在token没有达到过期时间时主动使token过期,这时redis内的token因为没有到达过期时间,所以通过getAccessToken获取时还是会获取到redis内缓存的token,导致触发token过期报错,应在PostMsg之后,判断postResponse error code 为42001 后主动删除redis内的access token的key,并再次获取access token,并重试PostMsg

@q629988171
Copy link
Contributor

@easychen 确认合并 @fcbhank 感谢贡献,看了一下请求前再次刷新access_token的方法,还是有可能不能覆盖一部分token过期场景,目前来看企业微信有时会在token没有达到过期时间时主动使token过期,这时redis内的token因为没有到达过期时间,所以通过getAccessToken获取时还是会获取到redis内缓存的token,导致触发token过期报错,应在PostMsg之后,判断postResponse error code 为42001 后主动删除redis内的access token的key,并再次获取access token,并重试PostMsg

没错, 我之前说的就是这个意思.

@easychen easychen merged commit 94cba05 into easychen:main Aug 19, 2021
@fcbhank fcbhank deleted the dev branch August 19, 2021 09:22
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.

4 participants