mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-11-10 06:25:00 +00:00
Fix io-uring initialization
This commit is contained in:
parent
4a45aa889c
commit
f97f76c01e
1 changed files with 9 additions and 11 deletions
20
src/main.rs
20
src/main.rs
|
@ -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()?
|
||||
|
|
Loading…
Reference in a new issue