Skip to content
Back to skills

Http Retry

ASecurity

**触发词**: timeouterror, econnreset, econnrefused, 429, retry, http error, 网络超时

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 20, 2026
developmentjavascriptjava

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 20, 2026

npx -y skills add johnalbertini14-glitch/openclaw-skills --skill http-retry --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Http Retry?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Http Retry
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/johnalbertini14-glitch-http-retry-openclaw-skills/badge)](https://www.skillsdirectory.com/skills/johnalbertini14-glitch-http-retry-openclaw-skills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# 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)));
    }
  }
}
```

Files in this skill

  • SKILL.md1 KB
  • _meta.json275 B
  • package.json43 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.