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

Changeset 1454

Show
Ignore:
Timestamp:
11/28/06 16:25:43
Author:
fumanchu
Message:

Fix for the fix for #604 (session lockfile warning).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/sessions.py

    r1452 r1454  
    228228    LOCK_SUFFIX = '.lock' 
    229229     
    230     def __init__(self, id=None, **kwargs): 
    231         Session.__init__(self, id, **kwargs) 
    232          
     230    def setup(self): 
    233231        # Warn if any lock files exist at startup. 
    234232        lockfiles = [fname for fname in os.listdir(self.storage_path) 
     
    427425        id = request.cookie[name].value 
    428426     
    429     if not hasattr(cherrypy, "session"): 
    430         cherrypy.session = cherrypy._ThreadLocalProxy('session', _def_session) 
    431      
    432427    # Create and attach a new Session instance to cherrypy._serving. 
    433428    # It will possess a reference to (and lock, and lazily load) 
     
    437432    kwargs['clean_freq'] = clean_freq 
    438433    cherrypy._serving.session = sess = globals()[storage_class](id, **kwargs) 
     434     
     435    if not hasattr(cherrypy, "session"): 
     436        cherrypy.session = cherrypy._ThreadLocalProxy('session', _def_session) 
     437        if hasattr(sess, "setup"): 
     438            sess.setup() 
    439439     
    440440    if locking == 'implicit': 

Hosted by WebFaction

Log in as guest/cpguest to create tickets