зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1607411 - Automatically remove broken files from cache r=rwood
when a tarball is broken and in the cache, the condprof client will loop on trying to extract its content and eventually fail. On any tar extraction error, we delete the file from the cache to get a fresh on Differential Revision: https://phabricator.services.mozilla.com/D58917 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
f1826cfaf7
Коммит
8ee894efa8
|
@ -98,6 +98,10 @@ def get_profile(
|
|||
tar.extract = functools.partial(_extract, tar)
|
||||
tar.extractall(target_dir)
|
||||
except (OSError, tarfile.ReadError) as e:
|
||||
LOG("Failed to extract the tarball")
|
||||
if download_cache and os.path.exists(archive):
|
||||
LOG("Removing cached file to attempt a new download")
|
||||
os.remove(archive)
|
||||
raise ProfileNotFoundError(str(e))
|
||||
finally:
|
||||
if not download_cache:
|
||||
|
|
Загрузка…
Ссылка в новой задаче