fix: Potential task queue saturation in Notion importer (#11428)

* fix: Potential task queue saturation in Notion import

* Reduces concurrent Notion API pressure from 3× the recursive call depth down to 1
This commit is contained in:
Tom Moor
2026-02-12 21:56:00 -05:00
committed by GitHub
parent 5d749efd84
commit 0722b42613
2 changed files with 5 additions and 8 deletions
@@ -44,9 +44,10 @@ export default class NotionAPIImportTask extends APIImportTask<IntegrationServic
const client = new NotionClient(integration.authentication.token);
const parsedPages = await Promise.all(
importTask.input.map(async (item) => this.processPage({ item, client }))
);
const parsedPages: (ParsePageOutput | null)[] = [];
for (const item of importTask.input) {
parsedPages.push(await this.processPage({ item, client }));
}
// Filter out any null results (from pages/databases that couldn't be accessed)
const validParsedPages = parsedPages.filter(Boolean) as ParsePageOutput[];
+1 -5
View File
@@ -327,11 +327,7 @@ export default abstract class APIImportTask<
const uploadItems = Object.entries(urlToAttachment).map(
([url, attachment]) => ({ attachmentId: attachment.id, url })
);
// publish task after attachments are persisted in DB.
const job = await new UploadAttachmentsForImportTask().schedule(
uploadItems
);
await job.finished();
await new UploadAttachmentsForImportTask().schedule(uploadItems);
} catch (err) {
// upload attachments failure is not critical enough to fail the whole import.
Logger.error(