Ben Bangert avatar Ben Bangert committed c15d289

Tag 1.5 final

Comments (0)

Files changed (3)

 
 # Initialize the cache region dict
 cache_regions = {}
+cache_managers = {}
 
 # Load up the additional entry point defined backends
 for entry_point in pkg_resources.iter_entry_points('beaker.backends'):
             if not cache[0]:
                 if region not in cache_regions:
                     raise BeakerException('Cache region not configured: %s' % region)
-                cache[0] = Cache(namespace, **cache_regions[region])
+                cache[0] = cache_managers.setdefault(namespace + str(reg), Cache(namespace, **reg))
             
             cache_key = key + " " + " ".join(str(x) for x in args)
             def go():
     else:
         region = cache_regions[region]
     
-    cache = Cache(namespace, **region)
+    cache = cache_managers.setdefault(namespace + str(region), Cache(namespace, **region))
     cache_key = " ".join(str(x) for x in args)
     cache.remove_value(cache_key)
 
         
         """
         self.kwargs = kwargs
-        self.caches = {}
         self.regions = kwargs.pop('cache_regions', {})
         
         # Add these regions to the module global
     def get_cache(self, name, **kwargs):
         kw = self.kwargs.copy()
         kw.update(kwargs)
-        return self.caches.setdefault(name + str(kw), Cache(name, **kw))
+        return cache_managers.setdefault(name + str(kw), Cache(name, **kw))
     
     def get_cache_region(self, name, region):
         if region not in self.regions:
             raise BeakerException('Cache region not configured: %s' % region)
         kw = self.regions[region]
-        return self.caches.setdefault(name + str(kw), Cache(name, **kw))
+        return cache_managers.setdefault(name + str(kw), Cache(name, **kw))
     
     def region(self, region, *args):
         """Decorate a function to cache itself using a cache region

beaker/ext/memcached.py

         elif data_dir:
             self.lock_dir = data_dir + "/container_mcd_lock"
         if self.lock_dir:
-            verify_directory(self.lock_dir)
+            verify_directory(self.lock_dir)            
         
         self.mc = MemcachedNamespaceManager.clients.get(url, memcache.Client, url.split(';'))
 
 
 from setuptools import setup, find_packages
 
-version = '1.4.3'
+version = '1.5'
 
 pycryptopp = 'pycryptopp>=0.5.12'
 tests_require = ['nose', 'webtest']
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.