fix: concurrent upload to strapi by content type#337
Open
bosbaber wants to merge 2 commits into
Open
Conversation
✅ Deploy Preview for interledger-org-v5 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
05812be to
a2761da
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes the Strapi MDX sync script by running per-content-type sync work concurrently and improves dry-run logging for upload alt-text updates, aiming to reduce overall sync/dry-run duration.
Changes:
- Run
syncContentTypefor all configured content types concurrently and aggregate results afterward. - Improve dry-run log output for upload alt-text updates to show the target alt value and entry slug context.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cms/scripts/sync-mdx/syncCoordinator.ts |
Runs content-type sync in parallel via Promise.all and aggregates per-type results. |
cms/scripts/sync-mdx/mdxTransformer.ts |
Improves dry-run logging for upload alt text updates. |
Comment on lines
309
to
313
| if (dryRun) { | ||
| console.log( | ||
| ` 🏷️ [DRY-RUN] Would update alt text for upload #${id} from "${pathSlug}".` | ||
| ` 🏷️ [DRY-RUN] Would update alt text for upload #${id} to "${alt ?? 'null'}" (entry: "${pathSlug}").` | ||
| ) | ||
| updatedAltIds.set(id, alt) |
Comment on lines
+150
to
+152
| console.error( | ||
| `\n❌ Error syncing ${contentType}: ${(error as Error).message}` | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR proposes an optimisation to improve strapi sync and dry run actions through concurrency.
Checks
pnpm run formatpnpm run lintPR Checklist
feat: ...,fix: ...)