Make all storage use fsync
Hopefully costs little and increases robustness. Closes #75
This commit is contained in:
parent
99d8cbfbf6
commit
7a3b0830e1
@ -87,7 +87,8 @@ class LevelDB(Storage):
|
||||
self.get = self.db.get
|
||||
self.put = self.db.put
|
||||
self.iterator = self.db.iterator
|
||||
self.write_batch = partial(self.db.write_batch, transaction=True)
|
||||
self.write_batch = partial(self.db.write_batch, transaction=True,
|
||||
sync=True)
|
||||
|
||||
|
||||
class RocksDB(Storage):
|
||||
@ -105,6 +106,7 @@ class RocksDB(Storage):
|
||||
compression + "_compression")
|
||||
options = self.module.Options(create_if_missing=create,
|
||||
compression=compression,
|
||||
use_fsync=True,
|
||||
target_file_size_base=33554432,
|
||||
max_open_files=mof)
|
||||
self.db = self.module.DB(name, options)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user