mirror of https://github.com/zulip/zulip.git
zulip_tools: Rename may_be_perform_purging to maybe_perform_purging.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
d4c681a937
commit
e2cc554077
|
@ -6,7 +6,7 @@ import sys
|
||||||
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
sys.path.append(ZULIP_PATH)
|
sys.path.append(ZULIP_PATH)
|
||||||
|
|
||||||
from scripts.lib.zulip_tools import may_be_perform_purging, parse_cache_script_args
|
from scripts.lib.zulip_tools import maybe_perform_purging, parse_cache_script_args
|
||||||
|
|
||||||
YARN_CACHE_PATH = os.path.expanduser("~/.cache/yarn/")
|
YARN_CACHE_PATH = os.path.expanduser("~/.cache/yarn/")
|
||||||
CURRENT_VERSION = "v6"
|
CURRENT_VERSION = "v6"
|
||||||
|
@ -30,7 +30,7 @@ def remove_unused_versions_dir(args: argparse.Namespace) -> None:
|
||||||
return
|
return
|
||||||
|
|
||||||
no_headings = getattr(args, "no_headings", False)
|
no_headings = getattr(args, "no_headings", False)
|
||||||
may_be_perform_purging(
|
maybe_perform_purging(
|
||||||
dirs_to_purge,
|
dirs_to_purge,
|
||||||
{current_version_dir},
|
{current_version_dir},
|
||||||
"yarn cache",
|
"yarn cache",
|
||||||
|
|
|
@ -330,7 +330,7 @@ def purge_unused_caches(
|
||||||
caches_to_purge = get_caches_to_be_purged(caches_dir, caches_in_use, args.threshold_days)
|
caches_to_purge = get_caches_to_be_purged(caches_dir, caches_in_use, args.threshold_days)
|
||||||
caches_to_keep = all_caches - caches_to_purge
|
caches_to_keep = all_caches - caches_to_purge
|
||||||
|
|
||||||
may_be_perform_purging(
|
maybe_perform_purging(
|
||||||
caches_to_purge, caches_to_keep, cache_type, args.dry_run, args.verbose, args.no_headings
|
caches_to_purge, caches_to_keep, cache_type, args.dry_run, args.verbose, args.no_headings
|
||||||
)
|
)
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
|
@ -376,7 +376,7 @@ def generate_sha1sum_emoji(zulip_path: str) -> str:
|
||||||
return sha.hexdigest()
|
return sha.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def may_be_perform_purging(
|
def maybe_perform_purging(
|
||||||
dirs_to_purge: Set[str],
|
dirs_to_purge: Set[str],
|
||||||
dirs_to_keep: Set[str],
|
dirs_to_keep: Set[str],
|
||||||
dir_type: str,
|
dir_type: str,
|
||||||
|
|
|
@ -11,7 +11,7 @@ from scripts.lib import clean_unused_caches
|
||||||
from scripts.lib.zulip_tools import (
|
from scripts.lib.zulip_tools import (
|
||||||
DEPLOYMENTS_DIR,
|
DEPLOYMENTS_DIR,
|
||||||
get_recent_deployments,
|
get_recent_deployments,
|
||||||
may_be_perform_purging,
|
maybe_perform_purging,
|
||||||
su_to_zulip,
|
su_to_zulip,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ def main() -> None:
|
||||||
deployments_to_keep = get_recent_deployments(args.threshold_days)
|
deployments_to_keep = get_recent_deployments(args.threshold_days)
|
||||||
deployments_to_purge = get_deployments_to_be_purged(deployments_to_keep)
|
deployments_to_purge = get_deployments_to_be_purged(deployments_to_keep)
|
||||||
|
|
||||||
may_be_perform_purging(
|
maybe_perform_purging(
|
||||||
deployments_to_purge, deployments_to_keep, "deployment", args.dry_run, args.verbose, True
|
deployments_to_purge, deployments_to_keep, "deployment", args.dry_run, args.verbose, True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue