[PATCH] fetch2/wget: checkstatus: Do not try again on 404 status code
"Rouven Rastetter" <[email protected]>
| Newsgroups | org.openembedded.lists.bitbake-devel |
|---|---|
| Message-ID | <[email protected]> |
Http status 404 means, the server send a valid answer. A retry should
not change the answer and unnecessarily slows down sstate cache
checking.
---
lib/bb/fetch2/wget.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index 141c2d062..8a8d30ab3 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -421,7 +421,7 @@ class Wget(FetchMethod):
with opener.open(r, timeout=100) as response:
pass
except (urllib.error.URLError, OSError, http.client.RemoteDisconnected) as e:
- if try_again:
+ if try_again and getattr(e, 'code', None) != 404:
logger.debug2("checkstatus: trying again after exception %s" % str(e))
return self.checkstatus(fetch, ud, d, False)
else: