diff --git a/crates/aptos/src/common/utils.rs b/crates/aptos/src/common/utils.rs index 8bacbd1b4d849..0a9c766ff3074 100644 --- a/crates/aptos/src/common/utils.rs +++ b/crates/aptos/src/common/utils.rs @@ -35,6 +35,7 @@ use std::{ str::FromStr, time::{Duration, Instant, SystemTime}, }; +use tokio::time::timeout; /// Prompts for confirmation until a yes or no is given explicitly pub fn prompt_yes(prompt: &str) -> bool { @@ -81,7 +82,15 @@ pub async fn to_common_result( } else { None }; - send_telemetry_event(command, latency, !is_err, error).await; + + if let Err(err) = timeout( + Duration::from_millis(2000), + send_telemetry_event(command, latency, !is_err, error), + ) + .await + { + debug!("send_telemetry_event timeout from CLI: {}", err.to_string()) + } } let result: ResultWrapper = result.into();