mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
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:
@@ -41,7 +41,7 @@ def get_caches_in_use(threshold_days):
|
|||||||
|
|
||||||
for setup_dir in setups_to_check:
|
for setup_dir in setups_to_check:
|
||||||
node_modules_link_path = os.path.join(setup_dir, "node_modules")
|
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
|
# If 'package.json' file doesn't exist then no node_modules
|
||||||
# cache is associated with this setup.
|
# cache is associated with this setup.
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user