Skip to content
Browse files

[interop.sync] Added timeout param to main synchronizers

  • Loading branch information...
1 parent 0a7cf5a commit 7eb50859234c63f19cc34d3f65475ca4d8a16eb6 @nemesisdesign nemesisdesign committed
Showing with 10 additions and 1 deletion.
  1. +10 −1 nodeshot/interop/sync/synchronizers/base.py
View
11 nodeshot/interop/sync/synchronizers/base.py
@@ -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):
@@ -177,6 +178,14 @@ class GenericGisSynchronizer(HttpRetrieverMixin, BaseSynchronizer):
}
},
{
+ 'name': 'timeout',
+ 'class': 'IntegerField',
+ 'kwargs': {
+ 'default': 10,
+ 'help_text': _('Number of seconds after which the request expires')
+ }
+ },
+ {
'name': 'verify_ssl',
'class': 'BooleanField',
'kwargs': {

0 comments on commit 7eb5085

Please sign in to comment.
Something went wrong with that request. Please try again.