MCPcopy Create free account
hub / github.com/Xchristech2/Zenitsu-Bot / tryRequest

Function tryRequest

commands/video.js:12–25  ·  view source on GitHub ↗
(getter, attempts = 3)

Source from the content-addressed store, hash-verified

10};
11
12async function tryRequest(getter, attempts = 3) {
13 let lastError;
14 for (let attempt = 1; attempt <= attempts; attempt++) {
15 try {
16 return await getter();
17 } catch (err) {
18 lastError = err;
19 if (attempt < attempts) {
20 await new Promise(r => setTimeout(r, 1000 * attempt));
21 }
22 }
23 }
24 throw lastError;
25}
26
27// EliteProTech API - Primary
28async function getEliteProTechVideoByUrl(youtubeUrl) {

Callers 3

getYupraVideoByUrlFunction · 0.70
getOkatsuVideoByUrlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected