Fix io-uring initialization

This commit is contained in:
asonix 2023-10-07 12:12:40 -05:00
parent 4a45aa889c
commit f97f76c01e

View file

@ -1,22 +1,20 @@
fn main() -> color_eyre::Result<()> {
#[cfg(not(feature = "io-uring"))]
return run_tokio();
#[cfg(feature = "io-uring")]
return run_tokio_uring();
run()
}
#[cfg(feature = "io-uring")]
fn run_tokio_uring() -> color_eyre::Result<()> {
tokio_uring::start(run())
fn run() -> color_eyre::Result<()> {
tokio_uring::start(async move {
pict_rs::PictRsConfiguration::build_default()?
.install_tracing()?
.install_metrics()?
.run()
.await
})
}
#[cfg(not(feature = "io-uring"))]
#[tokio::main]
async fn run_tokio() -> color_eyre::Result<()> {
run().await
}
async fn run() -> color_eyre::Result<()> {
pict_rs::PictRsConfiguration::build_default()?
.install_tracing()?