mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 23:17:17 +02:00
Added cache-cleaning to the idmapper base class. This works to sync most changes from the admin site-side, but not location changes (which leaves the content cache stale). Thinking of testing the django in-built cache framework instead, maybe using custom fields?
This commit is contained in:
parent
0a39b8f65e
commit
deafb9c544
3 changed files with 28 additions and 4 deletions
|
|
@ -28,6 +28,7 @@ except ImportError:
|
|||
from django.db import transaction
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils.utils import to_str, uses_database
|
||||
from src.utils import logger
|
||||
|
||||
|
|
|
|||
|
|
@ -210,6 +210,8 @@ def update_cached_instance(sender, instance, **kwargs):
|
|||
if not hasattr(instance, 'cache_instance'):
|
||||
return
|
||||
sender.cache_instance(instance)
|
||||
from src.server.caches import flush_obj_caches
|
||||
flush_obj_caches(instance)
|
||||
post_save.connect(update_cached_instance)
|
||||
|
||||
def cache_size(mb=True):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue