Skip to content

Commit

Permalink
[interop.sync] Added timeout param to main synchronizers
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Jan 7, 2016
1 parent 0a7cf5a commit 7eb5085
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nodeshot/interop/sync/synchronizers/base.py
Expand Up @@ -130,8 +130,9 @@ def retrieve_data(self):
""" retrieve data from an HTTP URL """
# shortcuts for readability
url = self.config.get('url')
timeout = self.config.get('timeout')
# perform HTTP request and store content
self.data = requests.get(url, verify=self.verify_ssl, timeout=5).content
self.data = requests.get(url, verify=self.verify_ssl, timeout=timeout).content


class XMLParserMixin(object):
Expand Down Expand Up @@ -176,6 +177,14 @@ class GenericGisSynchronizer(HttpRetrieverMixin, BaseSynchronizer):
'help_text': _('URL containing geographical data')
}
},
{
'name': 'timeout',
'class': 'IntegerField',
'kwargs': {
'default': 10,
'help_text': _('Number of seconds after which the request expires')
}
},
{
'name': 'verify_ssl',
'class': 'BooleanField',
Expand Down

0 comments on commit 7eb5085

Please sign in to comment.