mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 11:39:35 +00:00
sync every txn
This commit is contained in:
parent
89b237af7e
commit
68dc872b88
2 changed files with 6 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2953,7 +2953,7 @@ dependencies = [
|
|||
"httpdate",
|
||||
"itoa",
|
||||
"pin-project-lite 0.2.13",
|
||||
"socket2 0.5.5",
|
||||
"socket2 0.4.10",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use rocksdb::{
|
||||
DBCompressionType, ThreadMode, SingleThreaded, LogLevel, Options, Transaction, TransactionDB,
|
||||
DBCompressionType, ThreadMode, SingleThreaded, LogLevel, WriteOptions, Transaction, Options,
|
||||
TransactionDB,
|
||||
};
|
||||
|
||||
use crate::*;
|
||||
|
@ -31,7 +32,9 @@ impl<T: ThreadMode> Get for Arc<TransactionDB<T>> {
|
|||
impl<T: ThreadMode + 'static> Db for Arc<TransactionDB<T>> {
|
||||
type Transaction<'a> = Transaction<'a, TransactionDB<T>>;
|
||||
fn txn(&mut self) -> Self::Transaction<'_> {
|
||||
self.transaction()
|
||||
let mut opts = WriteOptions::default();
|
||||
opts.set_sync(true);
|
||||
self.transaction_opt(&opts, &Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue