def getAutoExpiringSession(self, site):
"""
Create a new session which auto expires at cleanup.
@param site: The site on which the session is created.
@type site: L{server.Site}
@return: A newly created session.
@rtype: L{server.Session}
"""
session = site.makeSession()
# Clean delayed calls from session expiration.
self.addCleanup(session.expire)
return session
评论列表
文章目录