Merge pull request #23594 from rallytime/bp-23496

Backport #23496 to 2014.7
This commit is contained in:
Thomas S Hatch 2015-05-12 15:19:34 -06:00
commit 1acaf86da7

View File

@ -215,7 +215,9 @@ def reap_fileserver_cache_dir(cache_base, find_func):
# This will only remove the directory on the second time
# "_reap_cache" is called (which is intentional)
if len(dirs) == 0 and len(files) == 0:
os.rmdir(root)
# only remove if empty directory is older than 60s
if time.time() - os.path.getctime(root) > 60:
os.rmdir(root)
continue
# if not, lets check the files in the directory
for file_ in files: