Skip to content

Commit

Permalink
use tokio concurrency primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Apr 23, 2024
1 parent 6744405 commit c6cc67c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [0.1.21] - 2024-04-23
Use tokio concurrency primitives.

## [0.1.20] - 2024-04-20
Fixed a bug with snapshots when database is encrypted.

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rxqlite"
version = "0.1.20"
version = "0.1.21"
readme = "README.md"
edition = "2021"
authors = [
Expand Down
1 change: 0 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Notification system
## [0.1.6]
BYC: Bring Your Cryptography, in order to encrypt/decrypt raft log,
while sqlite will be encrypted using sqlite cipher.

6 changes: 3 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::BTreeSet;
use std::sync::Arc;
use std::sync::Mutex;
use tokio::sync::Mutex;

use openraft::error::NetworkError;
use openraft::error::RPCError;
Expand Down Expand Up @@ -380,7 +380,7 @@ impl RXQLiteClient {
Err: std::error::Error + Serialize + DeserializeOwned,
{
let (node_id, url) = {
let t = dest_node.lock().unwrap();
let t = dest_node.lock().await;
let target_addr = &t.1;
(
t.0,
Expand Down Expand Up @@ -479,7 +479,7 @@ impl RXQLiteClient {
{
// Update target to the new leader.
if let (Some(leader_id), Some(leader_node)) = (leader_id, leader_node) {
let mut t = self.leader.lock().unwrap();
let mut t = self.leader.lock().await;
let api_addr = leader_node.api_addr.clone();
*t = (*leader_id, api_addr);
} else {
Expand Down

0 comments on commit c6cc67c

Please sign in to comment.