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

[Bug]: 飞书响应超时导致消息事件错乱 #1

Closed
beetcb opened this issue Aug 22, 2021 · 0 comments
Closed

[Bug]: 飞书响应超时导致消息事件错乱 #1

beetcb opened this issue Aug 22, 2021 · 0 comments
Assignees

Comments

@beetcb
Copy link

beetcb commented Aug 22, 2021

作者您好!

我发现飞书目前有个响应 1s 限时,如果超时,将会多次重发,导致消息莫名奇妙地被发送多次,原文如下:

收到此请求后,需要在1秒内以 HTTP 200状态码 响应该请求,否则飞书开放平台会视此次推送失败并以5s、5m、1h、6h的间隔重新推送事件,最多重试4次。

我想解决方案应该是减少同步代码,先返回响应,再执行任务代码。考虑到 Worker 的运行机制,我一开始以为需要两个 Worker 才能解决这个问题,后面找着找着发现了 ExtendableEvent.waitUntil() 方法能够等待异步代码.

遗憾的是 Deno deploy 目前还不支持这个方法,所以提出这个问题,等支持后应该就可以修复啦,原文如下:

The waitUntil() method will be supported in future to execute code after returning a response.

@justjavac justjavac self-assigned this Mar 11, 2022
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