From: Oleg Broytman Date: Mon, 5 Aug 2024 10:41:08 +0000 (+0300) Subject: Refactor(Robots): Connect timeout X-Git-Tag: 5.4.1~1 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=e5e8af103c91963891c1e3be7f4bdbed5c30c35e;p=bookmarks_db.git Refactor(Robots): Connect timeout --- diff --git a/Robots/bkmk_rcurl.py b/Robots/bkmk_rcurl.py index 96f208c..e4ce184 100644 --- a/Robots/bkmk_rcurl.py +++ b/Robots/bkmk_rcurl.py @@ -39,8 +39,8 @@ class robot_curl(robot_base): curl.setopt(pycurl.SSL_VERIFYHOST, 2) curl.setopt(curl.CAINFO, certifi.where()) # Set timeouts to avoid hanging too long - curl.setopt(pycurl.CONNECTTIMEOUT, 30) - curl.setopt(pycurl.TIMEOUT, 60) + curl.setopt(pycurl.CONNECTTIMEOUT, self.connect_timeout) + curl.setopt(pycurl.TIMEOUT, self.timeout) # Parse Last-Modified curl.setopt(pycurl.OPT_FILETIME, 1) diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index 26a0fec..85edfed 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -78,6 +78,7 @@ class robot_base(Robot): # ...but aren't accessible even through proxy proxy_error = set() + connect_timeout = 30 timeout = 60 def __init__(self, *args, **kw): diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE index b1c249a..ddfb31f 100644 --- a/doc/ANNOUNCE +++ b/doc/ANNOUNCE @@ -7,6 +7,11 @@ bookmarks.html. WHAT'S NEW +Version 5.4.1 (2024-08-04) + + Separate connection timeout for PycURL robot. + Also will be used for aiohttp. + Version 5.4.0 (2024-08-02) Robot based on PycURL. diff --git a/doc/ChangeLog b/doc/ChangeLog index 8c1ee7a..57481c0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +Version 5.4.1 (2024-08-04) + + Separate connection timeout for PycURL robot. + Also will be used for aiohttp. + Version 5.4.0 (2024-08-02) Robot based on PycURL. diff --git a/setup.py b/setup.py index b6d05e3..27ef38b 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup setup( name='bookmarks_db', - version='5.4.0', + version='5.4.1', description='Bookmarks database and Internet robot', long_description=open('README', 'r').read(), long_description_content_type="text/plain",