[Zope-Checkins] CVS: Zope/lib/python/OFS - Application.py:1.191.2.11
Chris McDonough
chrism at plope.com
Sat May 22 23:52:25 EDT 2004
Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv16636/lib/python/OFS
Modified Files:
Tag: Zope-2_7-branch
Application.py
Log Message:
- Add "instance-local" "period" to TransientObjectContainer. This allows
users to dial a knob which may (or may not) reduce the number of conflicts
that happen during heavy sessioning usage by reducing the frequency at
which buckets potentially expire at the cost of expiration time
accuracy. Previously, this setting was hardcoded to 20 (seconds) at
module scope.
- Add 'session-resolution-seconds' to zope.conf.in/zopeschema.xml to
control instance-local period for /temp_folder/session_data.
- Update TOC UI, interface, and help files to deal with instance-local
period.
- Update OFS/Application to deal with instance-local period for default
/temp/session_data TOC.
- Use __setstate__ for TOC upgrade instead of a dedicated _upgrade method
(it was too hard to figure out where to call _upgrade from and when to
call it).
- Perform a few formatting changes that should make it easier to merge the 2.7
branch with the HEAD going forward. I beseech those who make formatting
changes to a branch or the HEAD make them to the other at that time
as well, especially with the SVN/CVS split it's very painful to do merging
when there are non-substantive differences between HEAD/maint. When I was
a child, I never thought I would need to use the word "beseech", however, it
has indeed happened.
=== Zope/lib/python/OFS/Application.py 1.191.2.10 => 1.191.2.11 ===
--- Zope/lib/python/OFS/Application.py:1.191.2.10 Tue May 18 03:11:09 2004
+++ Zope/lib/python/OFS/Application.py Sat May 22 23:51:55 2004
@@ -10,11 +10,10 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
-__doc__='''Application support
-
-$Id$'''
-__version__='$Revision$'[11:-2]
+"""Application support
+$Id$
+"""
import Globals,Folder,os,sys,App.Product, App.ProductRegistry, misc_
import time, traceback, os, Products
from DateTime import DateTime
@@ -324,10 +323,10 @@
def install_tempfolder_and_sdc(self):
app = self.getApp()
- from Products.ZODBMountPoint.MountedObject import manage_addMounts,\
- MountedObject
- from Products.ZODBMountPoint.MountedObject import getConfiguration as \
- getDBTabConfiguration
+ from Products.ZODBMountPoint.MountedObject \
+ import manage_addMounts, MountedObject
+ from Products.ZODBMountPoint.MountedObject \
+ import getConfiguration as getDBTabConfiguration
dbtab_config = getDBTabConfiguration()
@@ -376,9 +375,15 @@
delnotify = getattr(config, 'session_delete_notify_script_path',
None)
default_limit = 1000
+ default_period_secs = 20
+ default_timeout_mins = 20
+
limit = (getattr(config, 'maximum_number_of_session_objects', None)
or default_limit)
- timeout_spec = getattr(config, 'session_timeout_minutes', None)
+ timeout_spec = getattr(config, 'session_timeout_minutes',
+ default_timeout_mins)
+ period_spec = getattr(config, 'session_resolution_seconds',
+ default_period_secs)
if addnotify and app.unrestrictedTraverse(addnotify, None) is None:
LOG('Zope Default Object Creation', WARNING,
@@ -396,7 +401,8 @@
'session_data', 'Session Data Container',
addNotification = addnotify,
delNotification = delnotify,
- limit=limit)
+ limit=limit,
+ period_secs=period_spec)
if timeout_spec is not None:
toc = TransientObjectContainer('session_data',
@@ -404,7 +410,8 @@
timeout_mins = timeout_spec,
addNotification = addnotify,
delNotification = delnotify,
- limit=limit)
+ limit=limit,
+ period_secs = period_spec)
tf._setObject('session_data', toc)
tf_reserved = getattr(tf, '_reserved_names', ())
@@ -585,7 +592,6 @@
Products.meta_types=Products.meta_types+tuple(meta_types)
Globals.default__class_init__(Folder.Folder)
-
def get_products():
""" Return a list of tuples in the form:
More information about the Zope-Checkins
mailing list