mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Perf: speed up text line stream
This commit is contained in:
@@ -19,13 +19,12 @@ export const downloadMockAssets = task(require.main === module, __filename)((spa
|
||||
([filename, url]) => span
|
||||
.traceChildAsync(url, async () => {
|
||||
const res = await fetchWithRetry(url);
|
||||
|
||||
const src = path.join(OUTPUT_MOCK_DIR, filename);
|
||||
if (!res.body) {
|
||||
throw new Error(`Empty body from ${url}`);
|
||||
}
|
||||
|
||||
await mkdirp(OUTPUT_MOCK_DIR);
|
||||
const src = path.join(OUTPUT_MOCK_DIR, filename);
|
||||
|
||||
return pipeline(
|
||||
Readable.fromWeb(res.body),
|
||||
|
||||
Reference in New Issue
Block a user