@@ -188,6 +188,11 @@ def update_db_file(db_tmp_file, d, database_time):
api_key = d.getVar("NVDCVE_API_KEY") or None
attempts = int(d.getVar("CVE_DB_UPDATE_ATTEMPTS"))
+ # Recommended by NVD
+ wait_time = 6
+ if api_key:
+ wait_time = 2
+
while True:
req_args['startIndex'] = index
raw_data = nvd_request_next(url, attempts, api_key, req_args)
@@ -210,7 +215,7 @@ def update_db_file(db_tmp_file, d, database_time):
break
# Recommended by NVD
- time.sleep(6)
+ time.sleep(wait_time)
# Update success, set the date to cve_check file.
cve_f.write('CVE database update : %s\n\n' % datetime.date.today())