mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Fix for issue #23110
This resolves issues when the freshly created directory is removed by fileserver.update.
This commit is contained in:
parent
cd34b9b6c4
commit
d5ae1d268a
@ -215,6 +215,8 @@ def reap_fileserver_cache_dir(cache_base, find_func):
|
|||||||
# This will only remove the directory on the second time
|
# This will only remove the directory on the second time
|
||||||
# "_reap_cache" is called (which is intentional)
|
# "_reap_cache" is called (which is intentional)
|
||||||
if len(dirs) == 0 and len(files) == 0:
|
if len(dirs) == 0 and len(files) == 0:
|
||||||
|
# only remove if empty directory is older than 60s
|
||||||
|
if time.time() - os.path.getctime(root) > 60:
|
||||||
os.rmdir(root)
|
os.rmdir(root)
|
||||||
continue
|
continue
|
||||||
# if not, lets check the files in the directory
|
# if not, lets check the files in the directory
|
||||||
|
Loading…
Reference in New Issue
Block a user