parent
f05dd3006a
commit
d6bf6aba21
2 changed files with 4 additions and 2 deletions
4
data.py
4
data.py
|
|
@ -124,12 +124,14 @@ class BsdDB:
|
|||
p = self.ctype (p)
|
||||
return p
|
||||
|
||||
def put (self, key, val):
|
||||
def put (self, key, val, sync=False):
|
||||
key = autoBytes (key)
|
||||
val = autoBytes (val)
|
||||
if type (val) is not bytes:
|
||||
val = val.pack()
|
||||
self.db.put (key, val)
|
||||
if sync:
|
||||
self.db.sync()
|
||||
|
||||
class DB:
|
||||
def __init__ (self, dir, readonly=True):
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ def updateVersions (tag):
|
|||
obj = PathList()
|
||||
for idx, path in buf:
|
||||
obj.append (idx, path)
|
||||
db.vers.put (tag, obj)
|
||||
db.vers.put (tag, obj, sync=True)
|
||||
|
||||
def updateDefinitions (blobs):
|
||||
for blob in blobs:
|
||||
|
|
|
|||
Loading…
Reference in a new issue