diff options
-rw-r--r-- | meta/recipes-core/meta/cve-update-nvd2-native.bb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/meta/recipes-core/meta/cve-update-nvd2-native.bb b/meta/recipes-core/meta/cve-update-nvd2-native.bb index c85df23f59..e2584d21b3 100644 --- a/meta/recipes-core/meta/cve-update-nvd2-native.bb +++ b/meta/recipes-core/meta/cve-update-nvd2-native.bb | |||
@@ -119,6 +119,7 @@ def nvd_request_next(url, api_key, args): | |||
119 | import urllib.parse | 119 | import urllib.parse |
120 | import gzip | 120 | import gzip |
121 | import http | 121 | import http |
122 | import time | ||
122 | 123 | ||
123 | headers = {} | 124 | headers = {} |
124 | if api_key: | 125 | if api_key: |
@@ -140,13 +141,9 @@ def nvd_request_next(url, api_key, args): | |||
140 | 141 | ||
141 | r.close() | 142 | r.close() |
142 | 143 | ||
143 | except UnicodeDecodeError: | 144 | except Exception as e: |
144 | # Received garbage, retry | 145 | bb.debug(2, "CVE database: received error (%s), retrying (request: %s)" %(e, full_request)) |
145 | bb.debug(2, "CVE database: received malformed data, retrying (request: %s)" %(full_request)) | 146 | time.sleep(6) |
146 | pass | ||
147 | except http.client.IncompleteRead: | ||
148 | # Read incomplete, let's try again | ||
149 | bb.debug(2, "CVE database: received incomplete data, retrying (request: %s)" %(full_request)) | ||
150 | pass | 147 | pass |
151 | else: | 148 | else: |
152 | return raw_data | 149 | return raw_data |