mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
cache: Write cache_key_prefixes without any compression.
This ensures that the new choice of zstd compression does not break the previous, still-running, install during upgrades when the list of cache_key_prefixes is updated.
This commit is contained in:
committed by
Tim Abbott
parent
8022e26ed4
commit
db89874bb0
@@ -69,7 +69,17 @@ def update_cached_cache_key_prefixes() -> list[str]:
|
||||
continue
|
||||
with open(filename) as f:
|
||||
found_prefixes.add(f.readline().removesuffix("\n"))
|
||||
caches["default"].set("cache_key_prefixes", list(found_prefixes), timeout=60 * 60 * 24) # 24h
|
||||
|
||||
# We reach into the bmemcached client directly to do this set
|
||||
# *without* compression, so that changes in our choice of
|
||||
# bmemcached compression algorithm are always
|
||||
# backwards-compatible.
|
||||
caches["default"]._cache.set( # type: ignore[attr-defined] # not in stubs
|
||||
caches["default"].make_key("cache_key_prefixes"),
|
||||
list(found_prefixes),
|
||||
60 * 60 * 24, # 24h
|
||||
compress_level=0,
|
||||
)
|
||||
return list(found_prefixes)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user