multiAI Summary Pending
HTTP 重试技能
**触发词**: timeouterror, econnreset, econnrefused, 429, retry, http error, 网络超时
3,556 stars
byopenclaw
Installation
Claude Code / Cursor / Codex
$curl -o ~/.claude/skills/http-retry/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/2233admin/http-retry/SKILL.md"
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/http-retry/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How HTTP 重试技能 Compares
| Feature / Agent | HTTP 重试技能 | Standard Approach |
|---|---|---|
| Platform Support | multi | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
**触发词**: timeouterror, econnreset, econnrefused, 429, retry, http error, 网络超时
Which AI agents support this skill?
This skill is compatible with multi.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# HTTP 重试技能
**触发词**: timeouterror, econnreset, econnrefused, 429, retry, http error, 网络超时
## 问题
网络请求失败(超时、连接重置、限流)导致服务不稳定
## 解决方案
指数退避 + 超时控制 + 连接池复用
```javascript
async function fetchWithRetry(url, options = {}, maxRetries = 3) {
const { retryDelay = 1000, timeout = 30000 } = options;
for (let attempt = 0; attempt <= maxRetries; attempt++) {
try {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), timeout);
const response = await fetch(url, { ...options, signal: controller.signal });
clearTimeout(timeoutId);
if (response.status === 429 || response.status >= 500) {
await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt)));
continue;
}
return response;
} catch (err) {
if (attempt === maxRetries) throw err;
await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt)));
}
}
}
```