De-async two things that shouldn't have been async to begin with.

This commit is contained in:
Herbert Wolverson
2023-01-19 14:59:12 +00:00
parent 29a9985a5a
commit 7cb8f930d1
3 changed files with 4 additions and 12 deletions

View File

@@ -8,7 +8,7 @@ lazy_static! {
static ref TEST_BUSY: Mutex<bool> = Mutex::new(false);
}
pub async fn lqos_daht_test() -> BusResponse {
pub fn lqos_daht_test() -> BusResponse {
spawn_blocking(|| {
if let Some(_lock) = TEST_BUSY.try_lock() {
Command::new("/bin/ssh")

View File

@@ -122,19 +122,11 @@ fn handle_bus_requests(requests: &[BusRequest], responses: &mut Vec<BusResponse>
lqos_bus::BusResponse::Ack
}
BusRequest::UpdateLqosDTuning(..) => {
let tokio_rt = tokio::runtime::Builder::new_current_thread()
.enable_io()
.build()
.unwrap();
tokio_rt.block_on(tuning::tune_lqosd_from_bus(&req))
tuning::tune_lqosd_from_bus(&req)
}
#[cfg(feature = "equinix_tests")]
BusRequest::RequestLqosEquinixTest => {
let tokio_rt = tokio::runtime::Builder::new_current_thread()
.enable_io()
.build()
.unwrap();
tokio_rt.block_on(lqos_daht_test::lqos_daht_test())
lqos_daht_test::lqos_daht_test()
}
});
}

View File

@@ -22,7 +22,7 @@ pub fn tune_lqosd_from_config_file(config: &LibreQoSConfig) -> Result<()> {
Ok(())
}
pub async fn tune_lqosd_from_bus(request: &BusRequest) -> BusResponse {
pub fn tune_lqosd_from_bus(request: &BusRequest) -> BusResponse {
match request {
BusRequest::UpdateLqosDTuning(interval, tuning) => {
// Real-time tuning changes. Probably dangerous.