Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

RobertBolender
Copy link
Contributor

See #4464

@gatsbybot
Copy link
Collaborator

Deploy preview for gatsbygram ready!

Built with commit 1a3084b

https://deploy-preview-4493--gatsbygram.netlify.com

@gatsbybot
Copy link
Collaborator

Deploy preview for using-drupal ready!

Built with commit 1a3084b

https://deploy-preview-4493--using-drupal.netlify.com

@RobertBolender
Copy link
Contributor Author

@pieh, can you think of anything this PR needs before merging?

@pieh
Copy link
Contributor

pieh commented Mar 13, 2018

@awesomebob This looks fine for me!

Copy link
Contributor

@KyleAMathews KyleAMathews left a 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()
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@pieh
Copy link
Contributor

pieh commented Mar 13, 2018

Can we close this PR as it turns out this doesn't actually do anything?

@RobertBolender
Copy link
Contributor Author

@pieh Yes, I think we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants