clean-npm-cache: Use islink to check node_modules.

Very old Zulip deployments might have node_modules be an actual
directory, which we should ignore for the purposes of
garbage-collection.
This commit is contained in:
Tim Abbott 2018-03-29 10:42:55 -07:00
parent 382f93189f
commit ff92cdaaaf
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ def get_caches_in_use(threshold_days):
for setup_dir in setups_to_check:
node_modules_link_path = os.path.join(setup_dir, "node_modules")
if not os.path.exists(node_modules_link_path):
if not os.path.islink(node_modules_link_path):
# If 'package.json' file doesn't exist then no node_modules
# cache is associated with this setup.
continue