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

Fix: high cpu usage when using neovim proxy #223

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/helpers/processes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use crate::config::Config;
use anyhow::{anyhow, Result};
use std::sync::{atomic::AtomicBool, Arc};
use tokio::process::Command;
use std::{
sync::{atomic::AtomicBool, Arc},
time::Duration,
};
use tokio::{process::Command, time::sleep};

use super::{
directories, get_platform_name,
Expand Down Expand Up @@ -133,6 +136,8 @@ pub async fn handle_nvim_process(config: &Config, args: &[String]) -> Result<()>
_term.store(false, Ordering::Relaxed);
}
}
// short delay to a void high cpu usage
sleep(Duration::from_millis(200)).await;
}
Err(_) => return Err(anyhow!("Failed to wait on child process")),
}
Expand Down
Loading