@@ -169,15 +169,18 @@ impl TelemetryClient {
169
169
self . handle . abort ( ) ;
170
170
}
171
171
}
172
+
172
173
/// Shutdowns the telemetry client.
173
- pub async fn shutdown ( & self ) {
174
+ pub async fn shutdown ( self ) {
174
175
if let Err ( _e) = self
175
176
. worker
176
177
. send_msg ( TelemetryActions :: Lifecycle ( LifecycleAction :: Stop ) )
177
178
. await
178
179
{
179
180
self . handle . abort ( ) ;
180
181
}
182
+
183
+ let _ = self . handle . await ;
181
184
}
182
185
}
183
186
@@ -264,7 +267,6 @@ mod tests {
264
267
client. start ( ) . await ;
265
268
let _ = client. send ( & data) ;
266
269
client. shutdown ( ) . await ;
267
- let _ = client. handle . await ;
268
270
telemetry_srv. assert_hits_async ( 1 ) . await ;
269
271
}
270
272
@@ -304,7 +306,6 @@ mod tests {
304
306
client. start ( ) . await ;
305
307
let _ = client. send ( & data) ;
306
308
client. shutdown ( ) . await ;
307
- let _ = client. handle . await ;
308
309
telemetry_srv. assert_hits_async ( 1 ) . await ;
309
310
}
310
311
@@ -344,7 +345,6 @@ mod tests {
344
345
client. start ( ) . await ;
345
346
let _ = client. send ( & data) ;
346
347
client. shutdown ( ) . await ;
347
- let _ = client. handle . await ;
348
348
telemetry_srv. assert_hits_async ( 1 ) . await ;
349
349
}
350
350
@@ -384,7 +384,6 @@ mod tests {
384
384
client. start ( ) . await ;
385
385
let _ = client. send ( & data) ;
386
386
client. shutdown ( ) . await ;
387
- let _ = client. handle . await ;
388
387
telemetry_srv. assert_hits_async ( 1 ) . await ;
389
388
}
390
389
@@ -424,7 +423,6 @@ mod tests {
424
423
client. start ( ) . await ;
425
424
let _ = client. send ( & data) ;
426
425
client. shutdown ( ) . await ;
427
- let _ = client. handle . await ;
428
426
telemetry_srv. assert_hits_async ( 1 ) . await ;
429
427
}
430
428
@@ -464,7 +462,6 @@ mod tests {
464
462
client. start ( ) . await ;
465
463
let _ = client. send ( & data) ;
466
464
client. shutdown ( ) . await ;
467
- let _ = client. handle . await ;
468
465
telemetry_srv. assert_hits_async ( 1 ) . await ;
469
466
}
470
467
@@ -504,7 +501,6 @@ mod tests {
504
501
client. start ( ) . await ;
505
502
let _ = client. send ( & data) ;
506
503
client. shutdown ( ) . await ;
507
- let _ = client. handle . await ;
508
504
telemetry_srv. assert_hits_async ( 1 ) . await ;
509
505
}
510
506
@@ -544,7 +540,6 @@ mod tests {
544
540
client. start ( ) . await ;
545
541
let _ = client. send ( & data) ;
546
542
client. shutdown ( ) . await ;
547
- let _ = client. handle . await ;
548
543
telemetry_srv. assert_hits_async ( 1 ) . await ;
549
544
}
550
545
@@ -577,8 +572,6 @@ mod tests {
577
572
578
573
client. start ( ) . await ;
579
574
client. shutdown ( ) . await ;
580
- let _ = client. handle . await ;
581
-
582
575
// Check for 2 hits: app-started and app-closing.
583
576
telemetry_srv. assert_hits_async ( 2 ) . await ;
584
577
}
0 commit comments