]> git.phdru.name Git - bookmarks_db.git/commitdiff
Refactor(bkmk_rmultirequests): Change parent to `robot_base`
authorOleg Broytman <phd@phdru.name>
Mon, 19 Aug 2024 14:51:20 +0000 (17:51 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 7 Sep 2024 10:59:02 +0000 (13:59 +0300)
`bkmk_rmultirequests` instantiates `bkmk_rrequests` in the workers
but itself doesn't really use anything from `bkmk_rrequests`,
so it can be just a base robot.

Robots/bkmk_rmultirequests.py

index 624263ad976f658834bb81844471e897c08459c8..0c7dbd46e9c16453ded0de855231858dde17358a 100644 (file)
@@ -16,7 +16,7 @@ import concurrent.futures
 import os
 
 from bkmk_objects import copy_bkmk
-from Robots.bkmk_rrequests import robot_requests
+from Robots.base import robot_base
 from Robots.multi_mixin import multi_mixin
 from robots import import_robot, set_params, robot_params
 
@@ -24,7 +24,7 @@ from robots import import_robot, set_params, robot_params
 cpu_count = os.cpu_count()
 
 
-class robot_multirequests(multi_mixin, robot_requests):
+class robot_multirequests(multi_mixin, robot_base):
     concurrent_class = concurrent.futures.ProcessPoolExecutor  # or ThreadPoolExecutor # noqa: E501 line too long
 
     # We're I/O-bound, not CPU-bound
@@ -36,7 +36,7 @@ class robot_multirequests(multi_mixin, robot_requests):
             else self.concurrent_class
         self.concurrent_class_name = concurrent_class.__name__
         multi_mixin.__init__(self, *args, **kw)
-        robot_requests.__init__(self, *args, **kw)
+        robot_base.__init__(self, *args, **kw)
         self.executor = concurrent_class(max_workers=self.max_urls)
 
     def version_str(self):