diff options
-rw-r--r-- | meta/recipes-core/meta/cve-update-nvd2-native.bb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/recipes-core/meta/cve-update-nvd2-native.bb b/meta/recipes-core/meta/cve-update-nvd2-native.bb index dab0b69edc..0a8b6a8a0a 100644 --- a/meta/recipes-core/meta/cve-update-nvd2-native.bb +++ b/meta/recipes-core/meta/cve-update-nvd2-native.bb | |||
@@ -188,6 +188,11 @@ def update_db_file(db_tmp_file, d, database_time): | |||
188 | api_key = d.getVar("NVDCVE_API_KEY") or None | 188 | api_key = d.getVar("NVDCVE_API_KEY") or None |
189 | attempts = int(d.getVar("CVE_DB_UPDATE_ATTEMPTS")) | 189 | attempts = int(d.getVar("CVE_DB_UPDATE_ATTEMPTS")) |
190 | 190 | ||
191 | # Recommended by NVD | ||
192 | wait_time = 6 | ||
193 | if api_key: | ||
194 | wait_time = 2 | ||
195 | |||
191 | while True: | 196 | while True: |
192 | req_args['startIndex'] = index | 197 | req_args['startIndex'] = index |
193 | raw_data = nvd_request_next(url, attempts, api_key, req_args) | 198 | 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): | |||
210 | break | 215 | break |
211 | 216 | ||
212 | # Recommended by NVD | 217 | # Recommended by NVD |
213 | time.sleep(6) | 218 | time.sleep(wait_time) |
214 | 219 | ||
215 | # Update success, set the date to cve_check file. | 220 | # Update success, set the date to cve_check file. |
216 | cve_f.write('CVE database update : %s\n\n' % datetime.date.today()) | 221 | cve_f.write('CVE database update : %s\n\n' % datetime.date.today()) |