Skip to content

Commit a164834

Browse files
committed
Waiting for all requests to finish before closing q.
Fixes sveltejs#689
1 parent 7aa3e90 commit a164834

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api/export.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ async function _export({
173173
let match;
174174
let pattern = /<a ([\s\S]+?)>/gm;
175175

176-
let promise;
176+
const promises = [];
177177

178178
while (match = pattern.exec(cleaned)) {
179179
const attrs = match[1];
@@ -183,12 +183,12 @@ async function _export({
183183
const url = resolve(base.href, href);
184184

185185
if (url.protocol === protocol && url.host === host) {
186-
promise = handle(url);
186+
promises.push(handle(url));
187187
}
188188
}
189189
}
190190

191-
await promise;
191+
await Promise.all(promises);
192192
}
193193
}
194194
}

0 commit comments

Comments
 (0)