mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-07-26 07:58:14 +00:00
refactor: manualy build tokio runtime for k2v-cli
This commit is contained in:
@@ -388,8 +388,7 @@ impl Filter {
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
fn main() -> Result<(), Error> {
|
||||
if std::env::var("RUST_LOG").is_err() {
|
||||
std::env::set_var("RUST_LOG", "warn")
|
||||
}
|
||||
@@ -412,6 +411,14 @@ async fn main() -> Result<(), Error> {
|
||||
|
||||
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 {
|
||||
Command::Insert {
|
||||
partition_key,
|
||||
@@ -603,6 +610,5 @@ async fn main() -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user