mirror of
https://github.com/evennia/evennia.git
synced 2026-03-17 21:36:30 +01:00
Changed how the clean-cache script determines the size of the attribute cache.
This commit is contained in:
parent
e92c9ac93e
commit
73ff2afc78
1 changed files with 2 additions and 1 deletions
|
|
@ -448,5 +448,6 @@ class ClearAttributeCache(Script):
|
|||
def at_repeat(self):
|
||||
"called every 2 hours. Sets a max attr-cache limit to 100 MB." # enough for normal usage?
|
||||
global _ATTRIBUTE_CACHE
|
||||
if getsizeof(_ATTRIBUTE_CACHE) / 1024.0 > _ATTRIBUTE_CACHE_MAXSIZE:
|
||||
size = sum([sum([getsizeof(obj) for obj in dic.values()]) for dic in _ATTRIBUTE_CACHE.values()])
|
||||
if size / 1024.0 > _ATTRIBUTE_CACHE_MAXSIZE:
|
||||
_ATTRIBUTE_CACHE = defaultdict(dict)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue