mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-03 17:40:34 +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",
|
"httpdate",
|
||||||
"itoa",
|
"itoa",
|
||||||
"pin-project-lite 0.2.13",
|
"pin-project-lite 0.2.13",
|
||||||
"socket2 0.5.5",
|
"socket2 0.4.10",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use rocksdb::{
|
use rocksdb::{
|
||||||
DBCompressionType, ThreadMode, SingleThreaded, LogLevel, Options, Transaction, TransactionDB,
|
DBCompressionType, ThreadMode, SingleThreaded, LogLevel, WriteOptions, Transaction, Options,
|
||||||
|
TransactionDB,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
@ -31,7 +32,9 @@ impl<T: ThreadMode> Get for Arc<TransactionDB<T>> {
|
||||||
impl<T: ThreadMode + 'static> Db for Arc<TransactionDB<T>> {
|
impl<T: ThreadMode + 'static> Db for Arc<TransactionDB<T>> {
|
||||||
type Transaction<'a> = Transaction<'a, TransactionDB<T>>;
|
type Transaction<'a> = Transaction<'a, TransactionDB<T>>;
|
||||||
fn txn(&mut self) -> Self::Transaction<'_> {
|
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