mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-16 04:11:01 +00:00
News timeout
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@61 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
49ec0c5071
commit
6938770a0b
1 changed files with 10 additions and 3 deletions
|
|
@ -178,11 +178,18 @@ class Configuration(UserDict.UserDict):
|
|||
|
||||
def _do_connectNntp(self):
|
||||
import nntplib
|
||||
timeout = 1
|
||||
while timeout:
|
||||
try:
|
||||
self.data["nntp"] = nntplib.NNTP(self.data["nntpserver"])
|
||||
except:
|
||||
print sys.exc_info()[:2]
|
||||
raise
|
||||
timeout = 0
|
||||
except nntplib.error_perm:
|
||||
value = sys.exc_info()[1]
|
||||
if re.compile("^505").search(str(value)):
|
||||
import whrandom,time
|
||||
time.sleep(whrandom.randint(30,60))
|
||||
else:
|
||||
raise
|
||||
|
||||
def hasMoreUrls_Threads(self):
|
||||
return not self.urls.empty()
|
||||
|
|
|
|||
Loading…
Reference in a new issue