http-retry

# HTTP 重试技能

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "http-retry" with this command: npx skills add 2233admin/http-retry

HTTP 重试技能

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

问题

网络请求失败(超时、连接重置、限流)导致服务不稳定

解决方案

指数退避 + 超时控制 + 连接池复用

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)));
    }
  }
}

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Miaoji Bid Guard Pro

亚马逊广告护城河Pro版,90天ROI预测+多活动协同+季节性出价+关键词攻防矩阵。 从单次调价建议升级为完整的广告战役规划。基础功能可使用 miaoji-bid-guard 免费版。

Registry SourceRecently Updated
General

Miaoji Compliance Copy Pro

亚马逊合规文案Pro版,多市场监管+法律风险评估+Rufus深度优化+季节性合规文案。 从单次文案检测升级为多市场合规体系。基础功能可使用 miaoji-compliance-copy 免费版。

Registry SourceRecently Updated
General

Miaoji Model Shot Pro

亚马逊模特拍摄Pro版,完整拍摄计划+季节性拍摄日历+多场景组合+同类视觉反超方案。 从单次拍摄建议升级为完整视觉战役。基础功能可使用 miaoji-model-shot 免费版。

Registry SourceRecently Updated
General

Miaoji Scene Studio Pro

亚马逊场景工作室Pro版,A/B测试方案+平台适配规格+季节性场景库+同类产品视觉差距分析。 从单次场景建议升级为完整视觉策略。基础功能可使用 miaoji-scene-studio 免费版。

Registry SourceRecently Updated