mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- fixed #499617 ("osc rbl hangs forever")
now we have a default timeout for all API requests (100 seconds)
This commit is contained in:
parent
6173598684
commit
9adde950df
@ -1484,7 +1484,7 @@ def makeurl(baseurl, l, query=[]):
|
||||
return urlunsplit((scheme, netloc, '/'.join(l), query, ''))
|
||||
|
||||
|
||||
def http_request(method, url, headers={}, data=None, file=None):
|
||||
def http_request(method, url, headers={}, data=None, file=None, timeout=100):
|
||||
"""wrapper around urllib2.urlopen for error handling,
|
||||
and to support additional (PUT, DELETE) methods"""
|
||||
|
||||
@ -1539,7 +1539,7 @@ def http_request(method, url, headers={}, data=None, file=None):
|
||||
if conf.config['debug']: print method, url
|
||||
|
||||
try:
|
||||
fd = urllib2.urlopen(req, data=data)
|
||||
fd = urllib2.urlopen(req, data=data, timeout=timeout)
|
||||
finally:
|
||||
if hasattr(conf.cookiejar, 'save'):
|
||||
conf.cookiejar.save(ignore_discard=True)
|
||||
|
Loading…
Reference in New Issue
Block a user