fix: rm deadlock
This commit is contained in:
parent
2aa4be8248
commit
815ef693a1
1 changed files with 11 additions and 14 deletions
|
@ -394,20 +394,19 @@ impl RaftStorage<ExampleTypeConfig> for Arc<ExampleStore> {
|
||||||
EntryPayload::Blank => res.push(ExampleResponse::Empty),
|
EntryPayload::Blank => res.push(ExampleResponse::Empty),
|
||||||
EntryPayload::Normal(ref req) => match req {
|
EntryPayload::Normal(ref req) => match req {
|
||||||
ExampleRequest::AddVisitor(msg) => {
|
ExampleRequest::AddVisitor(msg) => {
|
||||||
let sm = self.state_machine.read().await;
|
let r = sm
|
||||||
res.push(ExampleResponse::AddVisitorResult(
|
.data
|
||||||
sm.data
|
.master
|
||||||
.master
|
.send(msg.clone())
|
||||||
.send(msg.clone())
|
.await
|
||||||
.await
|
.unwrap()
|
||||||
.unwrap()
|
.await
|
||||||
.await
|
.unwrap()
|
||||||
.unwrap()
|
.unwrap();
|
||||||
.unwrap(),
|
|
||||||
));
|
res.push(ExampleResponse::AddVisitorResult(r));
|
||||||
}
|
}
|
||||||
ExampleRequest::AddCaptcha(msg) => {
|
ExampleRequest::AddCaptcha(msg) => {
|
||||||
let sm = self.state_machine.read().await;
|
|
||||||
sm.data
|
sm.data
|
||||||
.master
|
.master
|
||||||
.send(msg.clone())
|
.send(msg.clone())
|
||||||
|
@ -419,7 +418,6 @@ impl RaftStorage<ExampleTypeConfig> for Arc<ExampleStore> {
|
||||||
res.push(ExampleResponse::Empty);
|
res.push(ExampleResponse::Empty);
|
||||||
}
|
}
|
||||||
ExampleRequest::RenameCaptcha(msg) => {
|
ExampleRequest::RenameCaptcha(msg) => {
|
||||||
let sm = self.state_machine.read().await;
|
|
||||||
sm.data
|
sm.data
|
||||||
.master
|
.master
|
||||||
.send(msg.clone())
|
.send(msg.clone())
|
||||||
|
@ -431,7 +429,6 @@ impl RaftStorage<ExampleTypeConfig> for Arc<ExampleStore> {
|
||||||
res.push(ExampleResponse::Empty);
|
res.push(ExampleResponse::Empty);
|
||||||
}
|
}
|
||||||
ExampleRequest::RemoveCaptcha(msg) => {
|
ExampleRequest::RemoveCaptcha(msg) => {
|
||||||
let sm = self.state_machine.read().await;
|
|
||||||
sm.data
|
sm.data
|
||||||
.master
|
.master
|
||||||
.send(msg.clone())
|
.send(msg.clone())
|
||||||
|
|
Loading…
Reference in a new issue