Skip to content

Commit 0491298

Browse files
committed
Make multi-source documents requests sequentially
To prevent being detected as a bot
1 parent e069c8f commit 0491298

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/archivist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ export default class Archivist extends events.EventEmitter {
183183

184184
const fetchDocumentErrors = [];
185185

186-
await Promise.all(terms.sourceDocuments.map(async sourceDocument => {
186+
for (const sourceDocument of terms.sourceDocuments) {
187187
const { location: url, executeClientScripts, cssSelectors } = sourceDocument;
188188

189189
try {
190-
const { mimeType, content, fetcher } = await this.fetch({ url, executeClientScripts, cssSelectors });
190+
const { mimeType, content, fetcher } = await this.fetch({ url, executeClientScripts, cssSelectors }); // eslint-disable-line no-await-in-loop
191191

192192
sourceDocument.content = content;
193193
sourceDocument.mimeType = mimeType;
@@ -199,7 +199,7 @@ export default class Archivist extends events.EventEmitter {
199199

200200
fetchDocumentErrors.push(error);
201201
}
202-
}));
202+
}
203203

204204
if (fetchDocumentErrors.length) {
205205
throw new InaccessibleContentError(fetchDocumentErrors);

0 commit comments

Comments
 (0)