File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
crates/chat-cli/src/telemetry Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ pub use install_method::{
3636} ;
3737use tokio:: sync:: mpsc;
3838use tokio:: task:: JoinHandle ;
39+ use tokio:: time:: error:: Elapsed ;
3940use tracing:: {
4041 debug,
4142 error,
@@ -75,6 +76,8 @@ pub enum TelemetryError {
7576 Join ( #[ from] tokio:: task:: JoinError ) ,
7677 #[ error( transparent) ]
7778 Database ( #[ from] DatabaseError ) ,
79+ #[ error( transparent) ]
80+ Timeout ( #[ from] Elapsed ) ,
7881}
7982
8083impl From < amzn_toolkit_telemetry_client:: operation:: post_metrics:: PostMetricsError > for TelemetryError {
@@ -159,7 +162,7 @@ impl TelemetryThread {
159162 pub async fn finish ( self ) -> Result < ( ) , TelemetryError > {
160163 drop ( self . tx ) ;
161164 if let Some ( handle) = self . handle {
162- handle. await ? ;
165+ let _ = tokio :: time :: timeout ( std :: time :: Duration :: from_millis ( 100 ) , handle) . await ;
163166 }
164167
165168 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments