|
|
|
@ -125,14 +125,16 @@ ${converter.makeMarkdown(abstract ?? "")} |
|
|
|
|
* @param {string} url |
|
|
|
|
*/ |
|
|
|
|
async function resourceExists(url) { |
|
|
|
|
|
|
|
|
|
const time = Math.trunc(Math.random() * 10000); |
|
|
|
|
await sleep(time); |
|
|
|
|
|
|
|
|
|
const timer = setTimeout(() => console.log("not done", time, url), time + 3000); |
|
|
|
|
const timer = setTimeout(() => { |
|
|
|
|
console.log("retrying", time, url); |
|
|
|
|
resourceExists(url); |
|
|
|
|
}, time + 3000); |
|
|
|
|
const response = await fetch(url); |
|
|
|
|
|
|
|
|
|
clearTimeout(timer) |
|
|
|
|
clearTimeout(timer); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
response.status.toString().startsWith("2") || |
|
|
|
|