double sleep in reconnect_usb

This commit is contained in:
Aiden McClelland
2021-12-13 11:06:44 -07:00
committed by Aiden McClelland
parent b86a68640b
commit 50e7a31249

View File

@@ -124,11 +124,11 @@ pub async fn reconnect_usb(usb_device_path: impl AsRef<Path>) -> Result<(), Erro
authorized_file.write_all(b"0").await?;
authorized_file.sync_all().await?;
drop(authorized_file);
tokio::time::sleep(Duration::from_secs(1)).await;
tokio::time::sleep(Duration::from_secs(2)).await;
let mut authorized_file = tokio::fs::File::create(&authorized_path).await?;
authorized_file.write_all(b"1").await?;
authorized_file.sync_all().await?;
tokio::time::sleep(Duration::from_secs(1)).await;
tokio::time::sleep(Duration::from_secs(2)).await;
Ok(())
}