Compare commits

..

No commits in common. "b2078690bde33471955df0a03895a1c3e5f6013f" and "27e1caf1a6b687fd5742c03286c7a72321d41252" have entirely different histories.

2 changed files with 3 additions and 8 deletions

View file

@ -21,9 +21,6 @@ async function solve(flaresolverrUrl, targetUrl, opts = {}) {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
// FlareSolverr is told to give up at maxTimeout; if it doesn't answer
// even then, stop waiting rather than hanging the request for ever.
signal: AbortSignal.timeout((opts.maxTimeout || 60000) + 15000),
});
if (res.status >= 500) { lastErr = new Error(`FlareSolverr HTTP ${res.status}`); continue; }
if (!res.ok) throw new Error(`FlareSolverr HTTP ${res.status}`);
@ -32,7 +29,7 @@ async function solve(flaresolverrUrl, targetUrl, opts = {}) {
return data.solution.response;
} catch (err) {
lastErr = err;
if (!/HTTP 5\d\d|fetch failed|ECONNRESET|network|timeout|aborted/i.test(err.message)) throw err;
if (!/HTTP 5\d\d|fetch failed|ECONNRESET|network/i.test(err.message)) throw err;
}
}
throw lastErr;

View file

@ -993,8 +993,7 @@ async function downloadMakerworldFiles(html, skipNames = new Set()) {
}
const original = dl.name || `instance-${inst.id}.3mf`;
if (skipNames.has(original)) continue;
// A stalled CDN connection would otherwise hang the download for ever.
const resp = await fetch(dl.url, { signal: AbortSignal.timeout(180000) });
const resp = await fetch(dl.url);
if (!resp.ok) {
console.warn(`MakerWorld CDN download ${resp.status} for ${original}`);
problems.push({ message: `Downloading ${original} from MakerWorld failed (HTTP ${resp.status})` });
@ -1065,8 +1064,7 @@ async function downloadThingiverseFiles(meta, skipNames = new Set()) {
for (const dl of meta.downloads) {
if (!fileProcessor.isAllowed(dl.name)) continue; // skip readmes/images
if (skipNames.has(dl.name)) continue;
// A stalled CDN connection would otherwise hang the download for ever.
const resp = await fetch(dl.url, { signal: AbortSignal.timeout(180000) });
const resp = await fetch(dl.url);
if (!resp.ok) { console.error(`Download failed (${resp.status}): ${dl.name}`); continue; }
const buffer = Buffer.from(await resp.arrayBuffer());
const fileName = uniqueName(dl.name);