mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-27 15:37:03 +00:00
refactor: manualy build tokio runtime for k2v-cli
This commit is contained in:
@@ -388,8 +388,7 @@ impl Filter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
fn main() -> Result<(), Error> {
|
||||||
async fn main() -> Result<(), Error> {
|
|
||||||
if std::env::var("RUST_LOG").is_err() {
|
if std::env::var("RUST_LOG").is_err() {
|
||||||
std::env::set_var("RUST_LOG", "warn")
|
std::env::set_var("RUST_LOG", "warn")
|
||||||
}
|
}
|
||||||
@@ -412,6 +411,14 @@ async fn main() -> Result<(), Error> {
|
|||||||
|
|
||||||
let client = K2vClient::new(config)?;
|
let client = K2vClient::new(config)?;
|
||||||
|
|
||||||
|
tokio::runtime::Builder::new_current_thread()
|
||||||
|
.enable_all()
|
||||||
|
.build()
|
||||||
|
.unwrap()
|
||||||
|
.block_on(run(args))
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn run(args: Args) -> Result<(), Error> {
|
||||||
match args.command {
|
match args.command {
|
||||||
Command::Insert {
|
Command::Insert {
|
||||||
partition_key,
|
partition_key,
|
||||||
@@ -603,6 +610,5 @@ async fn main() -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user