Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
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
persistent
Commits
ff326cc6
Commit
ff326cc6
authored
Apr 09, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaks from @mgedmin.
parent
b3f5da74
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
persistent/picklecache.py
persistent/picklecache.py
+7
-6
No files found.
persistent/picklecache.py
View file @
ff326cc6
...
...
@@ -107,7 +107,7 @@ class PickleCache(object):
raise
TypeError
(
"Cache values must be persistent objects."
)
value_oid
=
value
.
_p_oid
if
not
isinstance
(
oid
,
OID_TYPE
)
or
not
isinstance
(
value_oid
,
OID_TYPE
):
# XXX bytes
if
not
isinstance
(
oid
,
OID_TYPE
)
or
not
isinstance
(
value_oid
,
OID_TYPE
):
raise
TypeError
(
'OID must be %s: key=%s _p_oid=%s'
%
(
OID_TYPE
,
oid
,
value_oid
))
if
value_oid
!=
oid
:
...
...
@@ -328,11 +328,12 @@ class PickleCache(object):
# actually runs (broken subclasses can forget to call super; ZODB
# has tests for this). This gets set to false everytime we examine
# a node and checked afterwards. The C implementation has a very
# incestuous relatio
u
nship between cPickleCache and cPersistence:
# incestuous relationship between cPickleCache and cPersistence:
# the pickle cache calls _p_deactivate, which is responsible for
# both decrementing the non-ghost count and removing its node from
# the cache ring. We're trying to keep that to a minimum, but
# there's no way around it if we want full compatibility
# the cache ring (and, if it gets deallocated, from the pickle
# cache's dictionary). We're trying to keep that to a minimum, but
# there's no way around it if we want full compatibility.
_persistent_deactivate_ran
=
False
@
_sweeping_ring
...
...
@@ -342,7 +343,7 @@ class PickleCache(object):
ejected
=
0
while
(
node
is
not
self
.
ring
and
(
self
.
non_ghost_count
>
target
and
(
self
.
non_ghost_count
>
target
or
(
target_size_bytes
and
self
.
total_estimated_size
>
target_size_bytes
))):
if
node
.
object
.
_p_state
==
UPTODATE
:
...
...
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