diff --git a/packages/gatsby-source-filesystem/README.md b/packages/gatsby-source-filesystem/README.md index 376241acc46f5..8496976d6a931 100644 --- a/packages/gatsby-source-filesystem/README.md +++ b/packages/gatsby-source-filesystem/README.md @@ -335,3 +335,11 @@ function createMySqlNodes({ name, __sql, idField, keys }, results, ctx) { module.exports = createMySqlNodes ``` + +## Troubleshooting + +In case that due to spotty network, or slow connection, some remote files fail to download. Even after multiple retries and adjusting concurrent downloads, you can adjust timeout and retry settings with these environment variables: + +- `STALL_RETRY_LIMIT`, default: `3` +- `STALL_TIMEOUT`, default: `30000` +- `CONNECTION_TIMEOUT`, default: `30000` diff --git a/packages/gatsby-source-filesystem/src/create-remote-file-node.js b/packages/gatsby-source-filesystem/src/create-remote-file-node.js index f121e6fb3c2a6..dfd1eeffd1f94 100644 --- a/packages/gatsby-source-filesystem/src/create-remote-file-node.js +++ b/packages/gatsby-source-filesystem/src/create-remote-file-node.js @@ -55,10 +55,10 @@ let totalJobs = 0 * @param {Reporter} [options.reporter] */ -const STALL_RETRY_LIMIT = 3 -const STALL_TIMEOUT = 30000 +const STALL_RETRY_LIMIT = process.env.GATSBY_STALL_RETRY_LIMIT || 3 +const STALL_TIMEOUT = process.env.GATSBY_STALL_TIMEOUT || 30000 -const CONNECTION_TIMEOUT = 30000 +const CONNECTION_TIMEOUT = process.env.GATSBY_CONNECTION_TIMEOUT || 30000 /******************** * Queue Management *