-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gatsby-source-contentful): fixed contentful asset download stalling with high number of assets #27563
fix(gatsby-source-contentful): fixed contentful asset download stalling with high number of assets #27563
Conversation
…ng with high number of assets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this approach. And you're right, we needed this throttle.
Thank you! 💜
Oh, well some tests need to be updated I guess. |
packages/gatsby-source-contentful/src/download-contentful-assets.js
Outdated
Show resolved
Hide resolved
b13089a
to
9ebd4d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you 💜
Published in |
@me4502 this seems to be "breaking" the progress bar of the reporter because now it's printing one 1/1 line per image downloaded. Also appears to be doing it one by one, rather than in pools of 50. Are you seeing this as well? |
I'll take a look tomorrow (Australia time), there's a chance some of the minor cleanups I did at the end may have modified behaviour - but it's working fine on my local patch. It does increase the number over time as it hasn't yet triggered the remote file download yet, but in my testing it was always faster to increase the number than it was to download, so it never triggered multiple messages (unless it was set to a small number such as 2) |
I got it. The |
Ah that explains it - I removed that when I added the config value as I assumed Joi would handle it. Thanks :) |
…ng with high number of assets (gatsbyjs#27563) * fix(gatsby-source-contentful): fixed contentful asset download stalling with high number of assets * Add new option to README * Fix test * Switch to pop and fix a typo made when cleaning up code
Description
With large Contentful sites, the number of assets can open too many connections for Node to handle. This leads to the download stalling. While the issue is unlikely to be encountered on a CI instance, on a local machine it can freeze downloads or even crash the machine in some cases. This PR adds a workload distribution system that limits the number of concurrent downloads, fixing the issue. The number is also configurable using a plugin option.
Documentation
Docs in the readme are updated.
Related Issues