Remove confusing contents-cache error. Resolves #1169
This commit is contained in:
parent
2a79f623c4
commit
cc354cc223
1 changed files with 4 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ from evennia.utils import logger
|
||||||
from evennia.utils.utils import make_iter, dbref, lazy_property
|
from evennia.utils.utils import make_iter, dbref, lazy_property
|
||||||
|
|
||||||
|
|
||||||
class ContentsHandler(object):
|
class ContentsHandler:
|
||||||
"""
|
"""
|
||||||
Handles and caches the contents of an object to avoid excessive
|
Handles and caches the contents of an object to avoid excessive
|
||||||
lookups (this is done very often due to cmdhandler needing to look
|
lookups (this is done very often due to cmdhandler needing to look
|
||||||
|
|
@ -79,8 +79,9 @@ class ContentsHandler(object):
|
||||||
try:
|
try:
|
||||||
return [self._idcache[pk] for pk in pks]
|
return [self._idcache[pk] for pk in pks]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# this means an actual failure of caching. Return real database match.
|
# this means the central instance_cache was totally flushed.
|
||||||
logger.log_err("contents cache failed for %s." % self.obj.key)
|
# Re-fetching from database will rebuild the necessary parts of the cache
|
||||||
|
# for next fetch.
|
||||||
return list(ObjectDB.objects.filter(db_location=self.obj))
|
return list(ObjectDB.objects.filter(db_location=self.obj))
|
||||||
|
|
||||||
def add(self, obj):
|
def add(self, obj):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue