-
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
gatsby-source-filesystem
Check if file exists locally before downloading
#4493
Conversation
Deploy preview for gatsbygram ready! Built with commit 1a3084b |
Deploy preview for using-drupal ready! Built with commit 1a3084b |
@pieh, can you think of anything this PR needs before merging? |
@awesomebob This looks fine for me! |
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.
Ah nice! Good idea to check if the file downloaded :-D
Could you not create a new function however — it's unnecessary new abstractions.
createNode(fileNode, { name: `gatsby-source-filesystem` }) | ||
resolve(fileNode) | ||
}) | ||
createFileSystemNode() |
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.
Could you not create a new function please
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 can change it, how would you prefer it to be handled?
The code needs to createFileNode
whether or not it has to download the remote file, and originally that function was being called on responseStream.on(
end)'.
Would you rather I just write out the function twice?
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.
Hmmm I'm not sure what this PR is fixing now. Files aren't redownloaded — a 304 response has an empty body.
Can we close this PR as it turns out this doesn't actually do anything? |
@pieh Yes, I think we can. |
See #4464