mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-24 11:12:14 +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, ''))
|
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,
|
"""wrapper around urllib2.urlopen for error handling,
|
||||||
and to support additional (PUT, DELETE) methods"""
|
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
|
if conf.config['debug']: print method, url
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fd = urllib2.urlopen(req, data=data)
|
fd = urllib2.urlopen(req, data=data, timeout=timeout)
|
||||||
finally:
|
finally:
|
||||||
if hasattr(conf.cookiejar, 'save'):
|
if hasattr(conf.cookiejar, 'save'):
|
||||||
conf.cookiejar.save(ignore_discard=True)
|
conf.cookiejar.save(ignore_discard=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user