A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: atproto rate limit header

+5 -3
+5 -3
src/components/output/raw/atproto/element.js
··· 165 165 * @returns {Promise<T>} 166 166 */ 167 167 async #withRetry(fn) { 168 - let delay = 30_000; 168 + let delay = 10_000; 169 169 for (let attempt = 0;; attempt++) { 170 170 try { 171 171 return await fn(); ··· 173 173 if (attempt < 5 && this.#isRateLimitError(err)) { 174 174 let wait = delay; 175 175 if (err instanceof ClientResponseError) { 176 - const retryAfter = err.headers.get("retry-after"); 177 - if (retryAfter) wait = parseFloat(retryAfter) * 1000; 176 + const resetAt = err.headers.get("ratelimit-reset"); 177 + if (resetAt) { 178 + wait = Math.max(0, parseFloat(resetAt) * 1000 - Date.now()); 179 + } 178 180 } 179 181 await new Promise((r) => setTimeout(r, wait)); 180 182 delay *= 2;