|
54 | 54 |
|
55 | 55 | import multiprocessing |
56 | 56 | from datetime import datetime |
57 | | -from typing import Dict, List, Optional |
| 57 | +from typing import Any, Dict, List, Optional |
58 | 58 |
|
59 | 59 | from sqlalchemy.orm import Session |
60 | 60 |
|
@@ -110,8 +110,12 @@ class AvailabilityCheckerBase(CheckerBase): |
110 | 110 | Optional, Activates/Disables the check of the status before the actual |
111 | 111 | status gathering. |
112 | 112 | :param bool use_whois_db: |
113 | | - Optional, Activates/Disable the usage of a local database to store the |
| 113 | + Optional, Activates/Disables the usage of a local database to store the |
114 | 114 | WHOIS datasets. |
| 115 | + :param bool use_platform: |
| 116 | + Optional, Activates/Disables the usage of the platform features. |
| 117 | + :param multiprocessing.Lock shared_lock: |
| 118 | + Optional, The shared lock to use to access shared resources. |
115 | 119 | """ |
116 | 120 |
|
117 | 121 | # pylint: disable=too-many-public-methods, too-many-instance-attributes |
@@ -160,6 +164,7 @@ def __init__( |
160 | 164 | db_session: Optional[Session] = None, |
161 | 165 | use_whois_db: Optional[bool] = None, |
162 | 166 | use_platform: Optional[bool] = None, |
| 167 | + shared_lock: Optional[Any] = None, |
163 | 168 | ) -> None: |
164 | 169 | self.dns_query_tool = DNSQueryTool() |
165 | 170 | self.whois_query_tool = WhoisQueryTool() |
@@ -226,6 +231,7 @@ def __init__( |
226 | 231 | do_syntax_check_first=do_syntax_check_first, |
227 | 232 | db_session=db_session, |
228 | 233 | use_platform=use_platform, |
| 234 | + shared_lock=shared_lock, |
229 | 235 | ) |
230 | 236 |
|
231 | 237 | @property |
@@ -761,7 +767,9 @@ def try_to_query_status_from_whois( |
761 | 767 | if ( |
762 | 768 | PyFunceble.facility.ConfigLoader.is_already_loaded() and self.use_whois_db |
763 | 769 | ): # pragma: no cover ## Not interesting enough to spend time on it. |
764 | | - whois_object = get_whois_dataset_object(db_session=self.db_session) |
| 770 | + whois_object = get_whois_dataset_object( |
| 771 | + db_session=self.db_session, shared_lock=self.shared_lock |
| 772 | + ) |
765 | 773 | known_record = whois_object[self.subject] |
766 | 774 |
|
767 | 775 | if known_record and not isinstance(known_record, dict): |
|
0 commit comments