Clarify HTTP 429 limits during PlatformIO package downloads

This commit is contained in:
Ivan Kravets
2026-02-23 14:44:27 +02:00
parent 104c872457
commit efa710d6b7
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ class HTTPSessionIterator:
total=5,
backoff_factor=1, # [0, 2, 4, 8, 16] secs
# method_whitelist=list(Retry.DEFAULT_METHOD_WHITELIST) + ["POST"],
status_forcelist=[413, 429, 500, 502, 503, 504],
status_forcelist=[413, 500, 502, 503, 504],
)
def __iter__(self): # pylint: disable=non-iterator-returned
+6
View File
@@ -17,6 +17,7 @@ from urllib.parse import urlparse
from platformio import __registry_mirror_hosts__
from platformio.cache import ContentCache
from platformio.exception import UserSideException
from platformio.http import HTTPClient
from platformio.registry.client import RegistryClient
@@ -61,6 +62,11 @@ class RegistryFileMirrorIterator:
),
x_with_authorization=RegistryClient.allowed_private_packages(),
)
if response.status_code == 429:
raise UserSideException(
"Download limit exceeded. Try again in 24 hours. "
"If this persists, contact <contact@platformio.org>"
)
stop_conditions = [
response.status_code not in (302, 307),
not response.headers.get("Location"),