fix(dev): stop discord smoke retries past deadline · openclaw/openclaw@6f3f4f7
vincentkoc
·
2026-05-30
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -543,7 +543,14 @@ async function requestDiscordJson<T>(params: {
|
543 | 543 | onTimeout: () => controller.abort(), |
544 | 544 | })) as { retry_after?: number }; |
545 | 545 | const waitSeconds = typeof body.retry_after === "number" ? body.retry_after : 1; |
546 | | -await sleepImpl(Math.min(Math.ceil(waitSeconds * 1000), remainingTimeoutMs(deadlineMs))); |
| 546 | +const waitMs = Math.ceil(waitSeconds * 1000); |
| 547 | +const remainingMs = remainingTimeoutMs(deadlineMs); |
| 548 | +if (waitMs >= remainingMs) { |
| 549 | +throw new Error( |
| 550 | +`${params.errorPrefix} ${params.method} ${redactDiscordApiPath(params.path)} exceeded total timeout before retry.`, |
| 551 | +); |
| 552 | +} |
| 553 | +await sleepImpl(waitMs); |
547 | 554 | continue; |
548 | 555 | } |
549 | 556 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。