1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

- fixed #499617 ("osc rbl hangs forever")

now we have a default timeout for all API requests (100 seconds)
This commit is contained in:
Marcus Hüwe 2009-05-05 15:56:23 +00:00
parent 6173598684
commit 9adde950df

View File

@ -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)