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

Add new curl function to limit how much of the file is returned #2599

Merged
merged 5 commits into from
Aug 9, 2018
Merged

Add new curl function to limit how much of the file is returned #2599

merged 5 commits into from
Aug 9, 2018

Conversation

janette
Copy link
Member

@janette janette commented Jul 19, 2018

Connects https://github.com/NuCivic/healthdata/issues/1062

Recap

When running $info = $this->getFileInfoHelper($url, FALSE) the content of the file is copied in full as curl_setopt($ch, CURLOPT_RANGE, '0-1000'); is not honored.
This causes out of memory errors when harvesting.

Creating a second helper function to run if $info = $this->getFileInfoHelper($url, TRUE) does not return the headers we need.

QA Steps

  • Create harvest source from https://data.cdc.gov/data.json
  • run drush dkan-h data_cdc_gov
  • confirm the harvest finishes AND the resource files are correctly saved as remote files and not as an api

@janette
Copy link
Member Author

janette commented Jul 23, 2018

this is similar to previous code #1590

@fmizzell fmizzell assigned fmizzell and unassigned dafeder Aug 2, 2018
@fmizzell fmizzell self-requested a review August 2, 2018 15:14
@@ -163,7 +197,7 @@ private function getFileInfoHelper($url, $no_body = TRUE) {
curl_setopt($ch, CURLOPT_NOBODY, 1);
}
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Range: bytes=0-1000"));
//curl_setopt($ch, CURLOPT_HTTPHEADER, array("Range: bytes=0-1000")); Not Effective.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is not working, lets go ahead an remove it.

@fmizzell fmizzell assigned janette and unassigned fmizzell Aug 2, 2018
@kimwdavidson kimwdavidson added this to the Sprint 3 milestone Aug 6, 2018
@janette
Copy link
Member Author

janette commented Aug 9, 2018

ok back to you @fmizzell

@fmizzell fmizzell merged commit b37fd6a into GetDKAN:7.x-1.x Aug 9, 2018
@janette janette deleted the 1062-getfileinfo branch November 6, 2018 14:01
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