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<()> { fn main() -> color_eyre::Result<()> {
#[cfg(not(feature = "io-uring"))] run()
return run_tokio();
#[cfg(feature = "io-uring")]
return run_tokio_uring();
} }
#[cfg(feature = "io-uring")] #[cfg(feature = "io-uring")]
fn run_tokio_uring() -> color_eyre::Result<()> { fn run() -> color_eyre::Result<()> {
tokio_uring::start(run()) tokio_uring::start(async move {
pict_rs::PictRsConfiguration::build_default()?
.install_tracing()?
.install_metrics()?
.run()
.await
})
} }
#[cfg(not(feature = "io-uring"))] #[cfg(not(feature = "io-uring"))]
#[tokio::main] #[tokio::main]
async fn run_tokio() -> color_eyre::Result<()> {
run().await
}
async fn run() -> color_eyre::Result<()> { async fn run() -> color_eyre::Result<()> {
pict_rs::PictRsConfiguration::build_default()? pict_rs::PictRsConfiguration::build_default()?
.install_tracing()? .install_tracing()?