From 0d2ddede40e40d879e30cc678b3821a2c0ba0147 Mon Sep 17 00:00:00 2001 From: cmm-lyft <181004184+cmm-lyft@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:05:07 -0600 Subject: [PATCH] Increasing timeout ratios for CVE API requests Signed-off-by: cmm-lyft <181004184+cmm-lyft@users.noreply.github.com> --- cartography/intel/cve/feed.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cartography/intel/cve/feed.py b/cartography/intel/cve/feed.py index c41be174b0..be1c860b82 100644 --- a/cartography/intel/cve/feed.py +++ b/cartography/intel/cve/feed.py @@ -22,9 +22,9 @@ logger = logging.getLogger(__name__) -MAX_RETRIES = 3 -# Connect and read timeouts of 60 seconds each; see https://requests.readthedocs.io/en/master/user/advanced/#timeouts -CONNECT_AND_READ_TIMEOUT = (60, 60) +MAX_RETRIES = 30 +# Connect and read timeouts of 120 seconds each; see https://requests.readthedocs.io/en/master/user/advanced/#timeouts +CONNECT_AND_READ_TIMEOUT = (120, 120) CVE_FEED_ID = "NIST_NVD" BATCH_SIZE_DAYS = 120 RESULTS_PER_PAGE = 2000 @@ -98,6 +98,7 @@ def _call_cves_api(url: str, api_key: str | None, params: Dict[str, Any]) -> Dic retries += 1 if retries >= MAX_RETRIES: raise + time.sleep(sleep_time) continue data = res.json() _map_cve_dict(results, data)