Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1705

Show
Ignore:
Timestamp:
08/22/07 00:54:09
Author:
fumanchu
Message:

Fix for #714 (bug in tools.caching). Also tweaked MemoryCache?.key to be faster when tools.caching.key is set.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-3.0.x/cherrypy/lib/caching.py

    r1703 r1705  
    55import cherrypy 
    66from cherrypy.lib import cptools, http 
     7 
     8 
     9_missing = object() 
    710 
    811 
     
    2932    def _key(self): 
    3033        request = cherrypy.request 
    31         return request.config.get("tools.caching.key", cherrypy.url(qs=request.query_string)) 
     34        key = request.config.get("tools.caching.key", _missing) 
     35        if key is _missing: 
     36            key = cherrypy.url(qs=request.query_string) 
     37        return key 
    3238    key = property(_key) 
    3339     
     
    8591     
    8692    def delete(self): 
    87         self.cache.pop(self.key
     93        self.cache.pop(self.key, None
    8894 
    8995 

Hosted by WebFaction

Log in as guest/cpguest to create tickets