return True
- def retrieve(self, url, **kwargs):
+ def retrieve(self, url, timeout=None, **kwargs):
"""
This method will fetch the content at the given URL
and will return a file-object to a temporary file.
req = self._make_request(url, **kwargs)
# Send request
- res = self._send_request(req)
+ res = self._send_request(req, timeout=timeout)
# Write the payload to the temporary file
with res as f:
try:
# Send the request
f = await asyncio.to_thread(
- self.downloader.retrieve, geofeed.url,
+ self.downloader.retrieve,
+
+ # Fetch the feed by its URL
+ geofeed.url,
+
+ # Send some extra headers
headers={
"User-Agent" : "location/%s" % location.__version__,
},
# Don't wait longer than 10 seconds for a response
- #timeout=10,
+ timeout=10,
)
# Remove any previous data