only store queries in debug mode
authorSverre Rabbelier <srabbelier@gmail.com>
Mon, 31 Aug 2009 05:06:17 -0700
changeset 2853 80a71738cb4f
parent 2852 cdef54d9a356
child 2854 003a84e774e2
only store queries in debug mode
app/soc/logic/models/base.py
--- a/app/soc/logic/models/base.py	Mon Aug 31 05:04:31 2009 -0700
+++ b/app/soc/logic/models/base.py	Mon Aug 31 05:06:17 2009 -0700
@@ -357,11 +357,14 @@
     """
 
     from google.appengine.api import memcache
-    queries = memcache.get('__melange_queries')
-    if not queries:
+    from soc.logic import system
+
+    if system.isDebug():
+      queries = memcache.get('__melange_queries')
+      if not queries:
         queries = []
-    queries.append((self._model.__name__, filter, order))
-    memcache.set('__melange_queries', queries)
+      queries.append((self._model.__name__, filter, order))
+      memcache.set('__melange_queries', queries)
 
     if not filter:
       filter = {}