Skip to content

Commit fe7359f

Browse files
committed
Build the Tokio runtime manually, without #[tokio::main]
1 parent 8b53b5e commit fe7359f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

crates/cli/src/main.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,15 @@ impl sentry::TransportFactory for SentryTransportFactory {
4949
}
5050
}
5151

52-
#[tokio::main]
53-
async fn main() -> anyhow::Result<ExitCode> {
52+
fn main() -> anyhow::Result<ExitCode> {
53+
let runtime = tokio::runtime::Builder::new_multi_thread()
54+
.enable_all()
55+
.build()?;
56+
57+
runtime.block_on(async_main())
58+
}
59+
60+
async fn async_main() -> anyhow::Result<ExitCode> {
5461
// We're splitting the "fallible" part of main in another function to have a
5562
// chance to shutdown the telemetry exporters regardless of if there was an
5663
// error or not

0 commit comments

Comments
 (0)