mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 15:44:50 -04:00
Empty iterables should count towards cache usage. (#9028)
This commit is contained in:
parent
0312266ee3
commit
1b4d5d6acf
3 changed files with 53 additions and 25 deletions
|
@ -105,7 +105,7 @@ class DeferredCache(Generic[KT, VT]):
|
|||
keylen=keylen,
|
||||
cache_name=name,
|
||||
cache_type=cache_type,
|
||||
size_callback=(lambda d: len(d)) if iterable else None,
|
||||
size_callback=(lambda d: len(d) or 1) if iterable else None,
|
||||
metrics_collection_callback=metrics_cb,
|
||||
apply_cache_factor_from_config=apply_cache_factor_from_config,
|
||||
) # type: LruCache[KT, VT]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue