]> git.phdru.name Git - bookmarks_db.git/commitdiff
Feat(Robots): Removed ftp_timeout
authorOleg Broytman <phd@phdru.name>
Tue, 10 Sep 2024 12:32:54 +0000 (15:32 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 10 Sep 2024 12:40:02 +0000 (15:40 +0300)
Robots/base.py
Robots/bkmk_raio.py
Robots/bkmk_rcurl.py
Robots/bkmk_rtwisted.py
doc/ANNOUNCE
doc/ChangeLog

index fa7178a5aaf6b11c7aa70da72640c530a507624d..b2e2dd97e39f50ba6932c06578ba1513bdbdfa1d 100644 (file)
@@ -79,12 +79,11 @@ class robot_base(Robot):
     proxy_error = set()
 
     timeout = 60
-    ftp_timeout = 60
 
     report_checked = True
 
     def __init__(self, *args, **kw):
-        for attr in 'timeout', 'ftp_timeout':
+        for attr in ['timeout']:
             value = getattr(self, attr)
             if not isinstance(value, int):
                 value = int(value)
index 65c22344f7cfa0780c4b193deecd965f059c5a61..42a766f5097a013273c06818e6c68a62124c2296 100644 (file)
@@ -68,7 +68,7 @@ class robot_aio(multi_mixin, robot_base):
     async def get(self, url, req_headers, use_proxy=False):
         if url.startswith('ftp://'):
             error, body = await _get_ftp(
-                url, timeout=self.ftp_timeout,
+                url, timeout=self.timeout,
             )
             if error is not None:
                 error = str(error)
index c3044546a8daaf988d7f76cbec4fa250c3bcb20b..6407153efe1b6637affe1206d4ac9d45f30d7128 100644 (file)
@@ -85,12 +85,8 @@ class CurlWrapper:
         curl.setopt(pycurl.SSL_VERIFYPEER, 0)
         curl.setopt(curl.CAINFO, certifi.where())
         # Set timeouts to avoid hanging too long
-        if url.startswith('ftp://'):
-            timeout = robot.ftp_timeout
-        else:
-            timeout = robot.timeout
-        curl.setopt(pycurl.CONNECTTIMEOUT, timeout)
-        curl.setopt(pycurl.TIMEOUT, timeout)
+        curl.setopt(pycurl.CONNECTTIMEOUT, robot.timeout)
+        curl.setopt(pycurl.TIMEOUT, robot.timeout)
         # Parse Last-Modified
         curl.setopt(pycurl.OPT_FILETIME, 1)
 
index 34a5fad503192a6f086c75ea8655c7cf61ea2362..f5f2f29493698a1a7abe3a8ca769d227dd510fef 100644 (file)
@@ -102,11 +102,7 @@ class robot_twisted(cf_multithread):
                     continue
 
                 # Setup timeout watch
-                if url.startswith('ftp://'):
-                    timeout = self.ftp_timeout
-                else:
-                    timeout = self.timeout
-                timeoutCall = reactor.callLater(timeout, d.cancel)
+                timeoutCall = reactor.callLater(self.timeout, d.cancel)
                 d.addBoth(self.cancelTimeout, timeoutCall)
 
                 d.addCallback(self.cbRequest, queue, timeoutCall)
index c0fa34045c08617e2ad0a845bab48023b5f5dd8d..7239608b2de3616f3ca02ab52f460cbf7ec3cd19 100644 (file)
@@ -17,6 +17,8 @@ Version 6.2.0 (2024-??-??)
 
    Default list of robots is still multirequests,aio.
 
+   Robots: Removed ftp_timeout.
+
 
 WHERE TO GET
    Home page:  https://phdru.name/Software/Python/#bookmarks_db
index 9182c44062fd086d057273706beb21441af01e04..50750a4dffbd4a4d76b6a378c27383f58b4a975e 100644 (file)
@@ -8,6 +8,8 @@ Version 6.2.0 (2024-??-??)
 
    Default list of robots is still multirequests,aio.
 
+   Robots: Removed ftp_timeout.
+
 Version 6.1.0 (2024-09-08)
 
    Combine aiohttp with multiaio; the combined robot is named just aio.