mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Tools: Download the Python constraint file less frequently
This commit is contained in:
parent
0265c79bcc
commit
1a9398799c
@ -31,6 +31,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import contextlib
|
import contextlib
|
||||||
import copy
|
import copy
|
||||||
|
import datetime
|
||||||
import errno
|
import errno
|
||||||
import functools
|
import functools
|
||||||
import hashlib
|
import hashlib
|
||||||
@ -1517,6 +1518,16 @@ def get_constraints(idf_version): # type: (str) -> str
|
|||||||
|
|
||||||
mkdir_p(os.path.dirname(temp_path))
|
mkdir_p(os.path.dirname(temp_path))
|
||||||
|
|
||||||
|
try:
|
||||||
|
age = datetime.date.today() - datetime.date.fromtimestamp(os.path.getmtime(constraint_path))
|
||||||
|
if age < datetime.timedelta(days=1):
|
||||||
|
info(f'Skipping the download of {constraint_path} because it was downloaded recently. If you believe '
|
||||||
|
f'that this is causing you trouble then remove it manually and re-run your install script.')
|
||||||
|
return constraint_path
|
||||||
|
except OSError:
|
||||||
|
# doesn't exist or inaccessible
|
||||||
|
pass
|
||||||
|
|
||||||
for _ in range(DOWNLOAD_RETRY_COUNT):
|
for _ in range(DOWNLOAD_RETRY_COUNT):
|
||||||
download(constraint_url, temp_path)
|
download(constraint_url, temp_path)
|
||||||
if not os.path.isfile(temp_path):
|
if not os.path.isfile(temp_path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user