Show More
@@ -17,6 +17,7 b' class transaction:' | |||||
17 | def __init__(self, opener, journal): |
|
17 | def __init__(self, opener, journal): | |
18 | self.opener = opener |
|
18 | self.opener = opener | |
19 | self.entries = [] |
|
19 | self.entries = [] | |
|
20 | self.map = {} | |||
20 | self.journal = journal |
|
21 | self.journal = journal | |
21 |
|
22 | |||
22 | # abort here if the journal already exists |
|
23 | # abort here if the journal already exists | |
@@ -30,7 +31,9 b' class transaction:' | |||||
30 | except: pass |
|
31 | except: pass | |
31 |
|
32 | |||
32 | def add(self, file, offset): |
|
33 | def add(self, file, offset): | |
|
34 | if file in self.map: return | |||
33 | self.entries.append((file, offset)) |
|
35 | self.entries.append((file, offset)) | |
|
36 | self.map[file] = 1 | |||
34 | # add enough data to the journal to do the truncate |
|
37 | # add enough data to the journal to do the truncate | |
35 | self.file.write("%s\0%d\n" % (file, offset)) |
|
38 | self.file.write("%s\0%d\n" % (file, offset)) | |
36 | self.file.flush() |
|
39 | self.file.flush() |
General Comments 0
You need to be logged in to leave comments.
Login now