Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve communication receiver loop #358

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mavlink/manager.rs
Expand Up @@ -36,7 +36,7 @@ impl Default for Manager {
let address =
settings::manager::mavlink_endpoint().expect("No configured mavlink endpoint");

let (sender, _receiver) = broadcast::channel(100);
let (sender, _receiver) = broadcast::channel(4000);

let this = Self {
connection: Arc::new(RwLock::new(Connection {
Expand Down Expand Up @@ -74,7 +74,7 @@ impl Manager {
fn receiver_loop(inner: Arc<RwLock<Connection>>) {
loop {
loop {
std::thread::sleep(std::time::Duration::from_millis(10));
std::thread::sleep(std::time::Duration::from_millis(1));

let Ok(inner_guard) = inner.read() else {
break; // Break to trigger reconnection
Expand Down