Show More
@@ -43,6 +43,12 b' Config::' | |||
|
43 | 43 | retry = 3 |
|
44 | 44 | retry.interval = 10 |
|
45 | 45 | |
|
46 | # the retry option can combine well with the http.timeout one. | |
|
47 | # | |
|
48 | # For example to give up on http request after 20 seconds: | |
|
49 | [http] | |
|
50 | timeout=20 | |
|
51 | ||
|
46 | 52 | [auth] |
|
47 | 53 | example.schemes = https |
|
48 | 54 | example.prefix = phab.example.com |
@@ -420,9 +426,12 b' def callconduit(ui, name, params):' | |||
|
420 | 426 | urlopener = urlmod.opener(ui, authinfo) |
|
421 | 427 | request = util.urlreq.request(pycompat.strurl(url), data=data) |
|
422 | 428 | max_try = ui.configint(b'phabricator', b'retry') + 1 |
|
429 | timeout = ui.configwith(float, b'http', b'timeout') | |
|
423 | 430 | for try_count in range(max_try): |
|
424 | 431 | try: |
|
425 |
with contextlib.closing( |
|
|
432 | with contextlib.closing( | |
|
433 | urlopener.open(request, timeout=timeout) | |
|
434 | ) as rsp: | |
|
426 | 435 | body = rsp.read() |
|
427 | 436 | break |
|
428 | 437 | except util.urlerr.urlerror as err: |
General Comments 0
You need to be logged in to leave comments.
Login now