Fixes issue #62.

This commit is contained in:
Bertrand Bordage 2016-10-23 21:22:22 +02:00
parent eef82f8aaa
commit 2cea2cd891
1 changed files with 3 additions and 5 deletions

View File

@ -26,6 +26,9 @@ class AtomicCache(dict):
self.update(data)
def commit(self):
# We import this here to avoid a circular import issue.
from .utils import _invalidate_tables
if self:
self.parent_cache.set_many(
self, cachalot_settings.CACHALOT_TIMEOUT)
@ -33,8 +36,3 @@ class AtomicCache(dict):
# invalidated in case another transaction occurred in the meantime.
_invalidate_tables(self.parent_cache, self.db_alias,
self.to_be_invalidated)
# We import this after AtomicCache to avoid a circular import issue and
# avoid importing this locally, which degrades performance.
from .utils import _invalidate_tables