Skip to content

Commit

Permalink
Update main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Jan 2, 2024
1 parent 83d0f8c commit e97ae48
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions examples/memstore/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ async fn leader_id(data: web::Data<(HashStore, Raft<LogEntry, HashStore>)>) -> i
format!("{:?}", leader_id)
}

// #[get("/leave")]
// async fn leave(
// data: web::Data<(HashStore, Raft<LogEntry, HashStore>)>,
// ) -> impl Responder {
// data.leave().await.unwrap();
// "OK".to_string()
// }
#[get("/leave")]
async fn leave(data: web::Data<(HashStore, Raft<LogEntry, HashStore>)>) -> impl Responder {
let raft = data.clone();
raft.1.raft_node.clone().leave().await;
"OK".to_string()
}

#[actix_rt::main]
async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
Expand Down

0 comments on commit e97ae48

Please sign in to comment.