From c5580607a7d8789627e70fc25ea5ba2a7a6bdb67 Mon Sep 17 00:00:00 2001 From: Riken Shah Date: Sat, 12 Jun 2021 06:31:50 +0000 Subject: [PATCH] purge-old-deployments: Use the `clean_unused_caches.main` function. We currently run the `clean_unused_caches.py` as a script to clean the unused caches. This commit replaces that with `clean_unused_caches.main` function as it would be faster. --- scripts/purge-old-deployments | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/purge-old-deployments b/scripts/purge-old-deployments index c6c2477225..63e1bb3988 100755 --- a/scripts/purge-old-deployments +++ b/scripts/purge-old-deployments @@ -7,6 +7,7 @@ from typing import Set ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(ZULIP_PATH) +from scripts.lib import clean_unused_caches from scripts.lib.zulip_tools import ( DEPLOYMENTS_DIR, get_recent_deployments, @@ -86,9 +87,7 @@ def main() -> None: print("Cleaning orphaned/unused caches...") # Call 'clean_unused_caches.py' script to clean any orphaned/unused caches. - subprocess.check_call( - [os.path.join(ZULIP_PATH, "scripts/lib/clean_unused_caches.py"), *sys.argv[1:]] - ) + clean_unused_caches.main(args) print("Done!")