File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 3636 lstrip_blocks = True ,
3737)
3838
39- PYPI_COOLDOWN = 0.2 # seconds to wait between requests to PyPI
39+ PYPI_COOLDOWN = 0.15 # seconds to wait between requests to PyPI
4040
4141PYPI_PROJECT_URL = "https://pypi.python.org/pypi/{project}/json"
4242PYPI_VERSION_URL = "https://pypi.python.org/pypi/{project}/{version}/json"
@@ -97,11 +97,11 @@ def fetch_url(url: str) -> Optional[dict]:
9797 if pypi_data .status_code == 200 :
9898 return pypi_data .json ()
9999
100- cooldown = PYPI_COOLDOWN * 2 ** attempt
100+ backoff = PYPI_COOLDOWN * 2 ** attempt
101101 print (
102- f"{ url } returned an error: { pypi_data .status_code } . Attempt { attempt + 1 } /3. Waiting { cooldown } s"
102+ f"{ url } returned an error: { pypi_data .status_code } . Attempt { attempt + 1 } /3. Waiting { backoff } s"
103103 )
104- time .sleep (cooldown )
104+ time .sleep (backoff )
105105
106106 return None
107107
You can’t perform that action at this time.
0 commit comments