Skip to content

Commit

Permalink
Attempt the non-blocking write in bg
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedSoliman committed May 28, 2024
1 parent 6b7c0dd commit 8bc0ad1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/rocksdb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ impl RocksDb {
// Auto...
// First, attempt to write without blocking
write_options.set_no_slowdown(true);
let result = self.db.write_batch(&write_batch, &write_options);

let result =
tokio::task::block_in_place(|| self.db.write_batch(&write_batch, &write_options));
match result {
Ok(_) => {
counter!(STORAGE_IO_OP,
Expand Down Expand Up @@ -247,7 +249,8 @@ impl RocksDb {
// Auto...
// First, attempt to write without blocking
write_options.set_no_slowdown(true);
let result = self.db.write_tx_batch(&write_batch, &write_options);
let result =
tokio::task::block_in_place(|| self.db.write_tx_batch(&write_batch, &write_options));
match result {
Ok(_) => {
counter!(STORAGE_IO_OP,
Expand Down

0 comments on commit 8bc0ad1

Please sign in to comment.