Skip to content

Commit

Permalink
fix rwlock when send proe message
Browse files Browse the repository at this point in the history
  • Loading branch information
yoloyyh committed Jan 22, 2024
1 parent 93a4493 commit 9c30272
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rasp/librasp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub mod async_command {
return Ok(status);
}
Ok(None) => {
sleep(Duration::from_secs(5));
sleep(Duration::from_secs(1));
}
Err(e) => {
warn!("attempting wait failed: {}", e);
Expand All @@ -77,7 +77,7 @@ pub mod async_command {
kill_child(pid as i32);
return;
}
sleep(Duration::from_secs(5));
sleep(Duration::from_secs(1));
})
.unwrap();

Expand Down
3 changes: 2 additions & 1 deletion rasp/rasp_server/src/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ pub async fn start_bind(sock: RASPSock) -> Result<(), String> {
(*pw).remove(&pid);
}
}
drop(pw);
sleep(Duration::from_secs(30)).await;
}
});
Expand All @@ -138,7 +139,7 @@ pub async fn start_bind(sock: RASPSock) -> Result<(), String> {
break;
}
Err(TryRecvError::Empty) => {
sleep(Duration::from_secs(30)).await;
sleep(Duration::from_secs(3)).await;
continue;
}
};
Expand Down

0 comments on commit 9c30272

Please sign in to comment.