From fbe7b87218a30d48edbfd9e6197eaec376162d59 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 4 Nov 2014 11:32:44 +0100 Subject: [PATCH] Fix debug output when updatecache parameter is not used in the query string --- src/cmsplugin_blurp/renderers/data_source.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmsplugin_blurp/renderers/data_source.py b/src/cmsplugin_blurp/renderers/data_source.py index 7c67962..155cbda 100644 --- a/src/cmsplugin_blurp/renderers/data_source.py +++ b/src/cmsplugin_blurp/renderers/data_source.py @@ -149,6 +149,7 @@ class Data(object): # If authentication is used if self.user_context: pre_hash += '-%s' % unicode(self.request.user).encode('utf-8') + log.debug('key pre hash value %r', pre_hash) self.key = hashlib.md5(pre_hash).hexdigest() self.now = time.time() self.__content = self.__CACHE_SENTINEL @@ -282,14 +283,14 @@ class Data(object): log.debug('self refresh is 0, ignoring cache') # do not use cache if updatecache is present in the query string use_cache = use_cache and (not self.request or 'updatecache' not in self.request.GET) - if self.request and 'updatecache' not in self.request.GET: + if self.request and 'updatecache' in self.request.GET: log.debug('updatecache in query string, ignoring cache') if use_cache: if until < self.now: # reload cache content asynchronously in a thread # and return the current content - log.debug('asynchronous update for url %r', self.url) + log.debug('asynchronous update for url %r until: %s < now: %s', self.url, until, self.now) c = self.CONDITIONS.setdefault(self.key, threading.Condition()) t = threading.Thread(target=self.update_content) t2 = self.UPDATE_THREADS.setdefault(self.key, t)