From 2cea2cd8917a1f0e60ee86663891d6007141f308 Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Sun, 23 Oct 2016 21:22:22 +0200 Subject: [PATCH] Fixes issue #62. --- cachalot/transaction.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cachalot/transaction.py b/cachalot/transaction.py index 868c60a..8e09c95 100644 --- a/cachalot/transaction.py +++ b/cachalot/transaction.py @@ -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