1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00

fix: flush and shutdown global tracer on exit

This commit is contained in:
Rob Ede 2024-06-05 15:37:10 +01:00
parent 1bae92b0fb
commit 6334049545
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933

View File

@ -28,5 +28,13 @@ async fn main() -> io::Result<()> {
.workers(2)
.bind(("127.0.0.1", 8080))?
.run()
.await?;
actix_web::web::block(move || {
opentelemetry::global::shutdown_tracer_provider();
})
.await
.unwrap();
Ok(())
}