Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
f3b4033d
Commit
f3b4033d
authored
Nov 17, 2001
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some debugging logic that logs at BLATHER if Z_TOC_DEBUG environment variable is set.
parent
ce202994
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
lib/python/Products/Transience/Transience.py
lib/python/Products/Transience/Transience.py
+30
-4
No files found.
lib/python/Products/Transience/Transience.py
View file @
f3b4033d
...
...
@@ -85,10 +85,10 @@
"""
Core session tracking SessionData class.
$Id: Transience.py,v 1.1
8 2001/11/14 00:19:58
chrism Exp $
$Id: Transience.py,v 1.1
9 2001/11/17 22:48:43
chrism Exp $
"""
__version__
=
'$Revision: 1.1
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
9
$'
[
11
:
-
2
]
import
Globals
from
Globals
import
HTMLFile
,
MessageDialog
...
...
@@ -103,7 +103,8 @@ from AccessControl.SecurityManagement import newSecurityManager
import
AccessControl.SpecialUsers
from
AccessControl.User
import
nobody
from
BTrees
import
OOBTree
from
zLOG
import
LOG
,
WARNING
from
zLOG
import
LOG
,
WARNING
,
BLATHER
import
os
import
os.path
import
math
import
time
...
...
@@ -111,6 +112,14 @@ import sys
import
random
from
types
import
InstanceType
DEBUG
=
os
.
environ
.
get
(
'Z_TOC_DEBUG'
,
''
)
def
TLOG
(
*
args
):
tmp
=
[]
for
arg
in
args
:
tmp
.
append
(
str
(
arg
))
LOG
(
'Transience DEBUG'
,
BLATHER
,
' '
.
join
(
tmp
))
_notfound
=
[]
_marker
=
[]
...
...
@@ -324,6 +333,8 @@ class TransientObjectContainer(SimpleItem):
method
=
callback
if
callable
(
method
):
if
DEBUG
:
TLOG
(
'calling %s at object %s'
%
(
callback
,
kind
))
try
:
user
=
getSecurityManager
().
getUser
()
try
:
...
...
@@ -405,6 +416,8 @@ class TransientObjectContainer(SimpleItem):
# no timeout always returns last bucket
if
not
self
.
_timeout_secs
:
b
,
dump_after
=
self
.
_ring
.
_data
[
0
]
if
DEBUG
:
TLOG
(
'no timeout, returning first bucket'
)
return
b
index
=
self
.
_ring
.
_index
now
=
int
(
time
())
...
...
@@ -415,6 +428,9 @@ class TransientObjectContainer(SimpleItem):
while
1
:
l
=
b
,
dump_after
=
self
.
_ring
.
_data
[
-
1
]
if
now
>
dump_after
:
if
DEBUG
:
TLOG
(
'now is %s'
%
now
)
TLOG
(
'dump_after for %s was %s, dumping'
%
(
b
,
dump_after
))
self
.
_ring
.
turn
()
# mutate elements in-place in the ring
new_dump_after
=
now
+
i
...
...
@@ -430,10 +446,20 @@ class TransientObjectContainer(SimpleItem):
return
b
def
_clean
(
self
,
b
,
index
):
for
k
,
v
in
list
(
index
.
items
()):
if
DEBUG
:
TLOG
(
'building list of index items'
)
l
=
list
(
index
.
items
())
if
DEBUG
:
TLOG
(
'done building list of index items, now iterating over them'
)
tmp
=
[]
for
k
,
v
in
l
:
if
v
is
b
:
tmp
.
append
(
k
)
self
.
notifyDestruct
(
index
[
k
][
k
])
del
index
[
k
]
if
DEBUG
:
TLOG
(
'deleted %s'
%
tmp
)
TLOG
(
'clearing %s'
%
b
)
b
.
clear
()
def
_show
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment