Skip to content

Commit

Permalink
Increasing timeout ratios for CVE API requests
Browse files Browse the repository at this point in the history
Signed-off-by: cmm-lyft <[email protected]>
  • Loading branch information
cmm-lyft committed Dec 6, 2024
1 parent 774d67b commit 0d2dded
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cartography/intel/cve/feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0d2dded

Please sign in to comment.