mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-22 07:56:26 +01:00
News download: Retry article download if temporary failure in DNS
This commit is contained in:
parent
f4f6d4d728
commit
a031f04e91
1 changed files with 2 additions and 1 deletions
|
|
@ -212,7 +212,8 @@ def fetch_url(self, url):
|
|||
if hasattr(err, 'code') and responses.has_key(err.code):
|
||||
raise FetchError, responses[err.code]
|
||||
if getattr(err, 'reason', [0])[0] == 104 or \
|
||||
getattr(getattr(err, 'args', [None])[0], 'errno', None) == -2: # Connection reset by peer or Name or service not know
|
||||
getattr(getattr(err, 'args', [None])[0], 'errno', None) in (-2,
|
||||
-3): # Connection reset by peer or Name or service not know
|
||||
self.log.debug('Temporary error, retrying in 1 second')
|
||||
time.sleep(1)
|
||||
with closing(open_func(url, timeout=self.timeout)) as f:
|
||||
|
|
|
|||
Loading…
Reference in a new issue