Skip to content

Commit

Permalink
Migration stability fix (await promise) (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipperolet authored Sep 8, 2023
1 parent cc00fae commit 166c1fb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions connectors/migrations/20230906_2_slack_fill_parents_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ async function updateParentsFieldForConnector(connector: Connector) {
console.log(`Updating ${chunk.length} documents`);
// update parents field for each document of the chunk, in parallel
await Promise.all(
chunk.map((documentIdAndChannel) =>
updateDocumentParentsField(connector, documentIdAndChannel.documentId, [
documentIdAndChannel.channelId,
])
chunk.map(
async (documentIdAndChannel) =>
await updateDocumentParentsField(
connector,
documentIdAndChannel.documentId,
[documentIdAndChannel.channelId]
)
)
);
}
Expand Down

0 comments on commit 166c1fb

Please sign in to comment.