mirror of
https://github.com/platformio/platformio-core.git
synced 2026-07-04 23:41:03 +02:00
Clarify HTTP 429 limits during PlatformIO package downloads
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user