mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
scripts: Fix incorrect garbage-collection of emoji/node caches.
Apparently, we were incorrectly expressing the paths in the caches_in_use data structures for these two cache-cleaning algorithms, resulting in the default threshhold_days algorithm controlling which caches could be garbage-collected. While the emoji one was just a performance optimization for upgrade-zulip-from-git, it was possible for the main `node_modules` cache in use in production to be GCed, resulting in LaTeX rendering being broken.
This commit is contained in:
@@ -35,7 +35,8 @@ def get_caches_in_use(threshold_days):
|
|||||||
# This happens for a deployment directory extracted from a
|
# This happens for a deployment directory extracted from a
|
||||||
# tarball, which just has a copy of the emoji data, not a symlink.
|
# tarball, which just has a copy of the emoji data, not a symlink.
|
||||||
continue
|
continue
|
||||||
caches_in_use.add(os.readlink(emoji_link_path))
|
# The actual cache path doesn't include the /emoji
|
||||||
|
caches_in_use.add(os.path.dirname(os.readlink(emoji_link_path)))
|
||||||
return caches_in_use
|
return caches_in_use
|
||||||
|
|
||||||
def main(args: argparse.Namespace) -> None:
|
def main(args: argparse.Namespace) -> None:
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ def get_caches_in_use(threshold_days):
|
|||||||
# 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
|
||||||
caches_in_use.add(os.readlink(node_modules_link_path))
|
# The actual cache path doesn't include the /node_modules
|
||||||
|
caches_in_use.add(os.path.dirname(os.readlink(node_modules_link_path)))
|
||||||
|
|
||||||
return caches_in_use
|
return caches_in_use
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user