clean-emoji-cache: Stop recalculating paths for other deployments.

This is the analog of 7b2c9223e7 for the
emoji cache; the only difference is that the existing code was working
correctly.  It's still worth changing for improved robustness.
This commit is contained in:
Tim Abbott 2018-03-28 15:48:29 -07:00
parent 7b2c9223e7
commit 838e5880b6
1 changed files with 5 additions and 6 deletions

View File

@ -30,13 +30,12 @@ def get_caches_in_use(threshold_days):
caches_in_use.add(CURRENT_CACHE)
for setup_dir in setups_to_check:
zulip_emoji_dir = os.path.join(setup_dir, "tools", "setup", "emoji")
if not os.path.exists(zulip_emoji_dir):
# Most probably this is a deployment directory extracted from a
# tarball so no emoji cache is associated with this.
emoji_link_path = os.path.join(setup_dir, "static/generated/emoji")
if not os.path.islink(emoji_link_path):
# This happens for a deployment directory extracted from a
# tarball, which just has a copy of the emoji data, not a symlink.
continue
sha1sum_emoji = generate_sha1sum_emoji(setup_dir)
caches_in_use.add(os.path.join(EMOJI_CACHE_PATH, sha1sum_emoji))
caches_in_use.add(os.readlink(emoji_link_path))
return caches_in_use
def main():