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

优化API请求超时处理与Webhook错误提示 #877

Closed
cfbsks opened this issue Oct 9, 2023 · 1 comment · Fixed by #879
Closed

优化API请求超时处理与Webhook错误提示 #877

cfbsks opened this issue Oct 9, 2023 · 1 comment · Fixed by #879
Labels
bug Something isn't working

Comments

@cfbsks
Copy link

cfbsks commented Oct 9, 2023

问题描述

在使用ddns-go服务时,我注意到每当DNS服务商的API接口出现网络访问超时(获取dns服务商记录 常出现在特定的时间例如每天7:30),服务都会触发webhook进行失败提示。

问题

  • 考虑到网络访问超时在实际应用中可能是一个常见的、偶发的现象,这种处理方式可能会导致大量不必要的错误提示。

  • Webhook的失败提示中缺少了关于API请求超时的具体信息,使得调试或了解错误背后的原因变得更加困难。

建议

  • 只有当连续多次超时时,才触发webhook进行错误提示。例如,连续3次请求超时后再发送通知。

  • 在Webhook的提示中增加API请求超时的具体信息,或者至少在webhook中允许展示失败的具体日志作为变量,这样可以帮助用户更好地了解问题背后的原因。

DNS服务商

Cloudflare

是否已搜索同类问题

已搜索,但未能解决

操作系统

Linux

架构

x86_64

版本

v5.6.1

安装方式

Docker

额外信息

请求接口https://api.cloudflare.com/client/v4/zones/c3f7e107e34effbc56b07bfad4e7d408/dns_records?type=AAAA&name=<mydomain.name>&per_page=50失败! ERROR: Get "https://api.cloudflare.com/client/v4/zones/c3f7e107e34effbc56b07bfad4e7d408/dns_records?type=AAAA&name=<mydomain.name>&per_page=50": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

@cfbsks cfbsks added the bug Something isn't working label Oct 9, 2023
@jeessy2
Copy link
Owner

jeessy2 commented Oct 9, 2023

请求列表接口失败会提示的,可以来PR,获取列表接口不提示了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants