Drupal Association members fund grants that make connections all over the world.
I have a target alter callback that fetches file contents from a URL using FeedsEnclosure::getContent() and another that uses FeedsEnclosure::getFile() which in turn calls FeedsEnclosure::getContent(). When using
drush queue-run feeds_source_import these both result in timeouts for files larger than around 2MB.
FeedsEnclosure::getContent() calls http_request_get which uses CURL. CURL timeout settings in http_request_get default to the variable http_request_timeout or 30 seconds introduced in, which also introduced the ability to set a custom timeout value for individual importers. FeedsEnclosure::getContent() does not currently pass a timeout value to http_request_timeout, therefore it always uses the http_request_timeout variable or 30 seconds.
Note: quickest solution would be to increase http_request_timeout variable. However, this issue is intended to highlight that individual importers have their own timeout settings and perhaps FeedsEnclosure could make use of those settings when calling http_request_get.
If I have understood the problem correctly then in my case I think the ideal solution would be for FeedsEnclosure::getContent() to make use of the custom timeout setting of the current importer fetcher. An alternative solution might be to allow modules to set a timeout value, either by passing it directly to FeedsEnclosure::getContent() or FeedsEnclosure::getFile() or by adding a timeout property to FeedsEnclosure that can be set when instantiating FeedsEnclosure and then used by FeedsEnclosure::getContent().