y
Size: a a a
y
R
R
N
N
N
N
MB
N
N
N
С
s
j
const delay = (time) => new Promise(resolve => setTimeout(resolve, time))
async function fetchWithRetry (url) {
for (let repeats = 0; repeats < 10; repeats++) {
try {
return await getData(url)
} catch (error) {
console.error(error)
await delay(1000)
}
}
throw Error('Fetch failed')
}
fetchWithRetry(url).then(console.log).catch(console.error)
С
s
ТТ
С