Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Nicolas Wavrant
ZODB
Commits
75523243
Commit
75523243
authored
Nov 18, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little cleanup and an added comment.
parent
afcccf13
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
src/ZODB/FileStorage.py
src/ZODB/FileStorage.py
+18
-16
No files found.
src/ZODB/FileStorage.py
View file @
75523243
...
...
@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version
# record.
#
__version__
=
'$Revision: 1.11
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.11
5
$'
[
11
:
-
2
]
import
base64
from
cPickle
import
Pickler
,
Unpickler
,
loads
...
...
@@ -286,6 +286,10 @@ class FileStorage(BaseStorage.BaseStorage,
)
self
.
_ltid
=
tid
# self._pos should always point just past the last
# transaction. During 2PC, data is written after _pos.
# invariant is restored at tpc_abort() or tpc_finish().
self
.
_ts
=
tid
=
TimeStamp
(
tid
)
t
=
time
.
time
()
t
=
apply
(
TimeStamp
,
(
time
.
gmtime
(
t
)[:
5
]
+
(
t
%
60
,)))
...
...
@@ -402,15 +406,12 @@ class FileStorage(BaseStorage.BaseStorage,
return
ltid
def
_restore_index
(
self
):
"""Load the database index from a file to support quick startup
"""
file_name
=
self
.
__name__
index_name
=
file_name
+
'.index'
try
:
f
=
open
(
index_name
,
'rb'
)
except
:
return
None
p
=
Unpickler
(
f
)
"""Load database index to support quick startup."""
try
:
f
=
open
(
"%s.index"
%
self
.
__name__
,
'rb'
)
except
:
return
None
p
=
Unpickler
(
f
)
try
:
info
=
p
.
load
()
...
...
@@ -419,16 +420,17 @@ class FileStorage(BaseStorage.BaseStorage,
warn
(
"Failed to load database index: %s: %s"
%
(
exc
,
err
))
return
None
index
=
info
.
get
(
'index'
)
pos
=
info
.
get
(
'pos'
)
oid
=
info
.
get
(
'oid'
)
vindex
=
info
.
get
(
'vindex'
)
index
=
info
.
get
(
'index'
)
pos
=
info
.
get
(
'pos'
)
oid
=
info
.
get
(
'oid'
)
vindex
=
info
.
get
(
'vindex'
)
if
index
is
None
or
pos
is
None
or
oid
is
None
or
vindex
is
None
:
return
None
pos
=
long
(
pos
)
tid
=
self
.
_sane
(
index
,
pos
)
if
not
tid
:
return
None
tid
=
self
.
_sane
(
index
,
pos
)
if
not
tid
:
return
None
return
index
,
vindex
,
pos
,
oid
,
tid
...
...
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