From abf9ad6c585d9bbd2530f5d04a0254f8dd478e3f Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 28 Jan 2020 13:42:14 -0500 Subject: [PATCH] Remove .cache from parent dir --- readthedocs/core/utils/general.py | 2 +- readthedocs/projects/tasks.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/readthedocs/core/utils/general.py b/readthedocs/core/utils/general.py index 34e4a34721e..63cc0c2dc66 100644 --- a/readthedocs/core/utils/general.py +++ b/readthedocs/core/utils/general.py @@ -20,7 +20,7 @@ def wipe_version_via_slugs(version_slug, project_slug): os.path.join(version.project.doc_path, 'checkouts', version.slug), os.path.join(version.project.doc_path, 'envs', version.slug), os.path.join(version.project.doc_path, 'conda', version.slug), - os.path.join(version.project.doc_path, '.cache', version.slug), + os.path.join(version.project.doc_path, '.cache'), ] for del_dir in del_dirs: broadcast(type='build', task=remove_dirs, args=[(del_dir,)]) diff --git a/readthedocs/projects/tasks.py b/readthedocs/projects/tasks.py index f910ce3ed3a..899e91aac3b 100644 --- a/readthedocs/projects/tasks.py +++ b/readthedocs/projects/tasks.py @@ -1554,8 +1554,11 @@ def clean_build(version_pk): # because we are syncing the servers with an async task. del_dirs = [ os.path.join(version.project.doc_path, dir_, version.slug) - for dir_ in ('checkouts', 'envs', 'conda', '.cache') + for dir_ in ('checkouts', 'envs', 'conda') ] + del_dirs.append( + os.path.join(version.project.doc_path, '.cache') + ) try: with version.project.repo_nonblockinglock(version): log.info('Removing: %s', del_dirs)