Skip to content

Commit

Permalink
Make start print the uuid of started task.
Browse files Browse the repository at this point in the history
  • Loading branch information
rescrv committed Dec 3, 2024
1 parent 5c3f2cc commit 35c8fce
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion rust/load/src/bin/chroma-load-start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,27 @@ async fn main() {
};
match client
.post(format!("{}/start", args.host))
.header(reqwest::header::ACCEPT, "application/json")
.json(&req)
.send()
.await
{
Ok(resp) => {
if resp.status().is_success() {
println!("Started workload on {}", args.host);
let uuid = match resp.text().await {
Ok(uuid) => uuid,
Err(err) => {
eprintln!("Failed to start workload on {}: {}", args.host, err);
return;
}
};
println!(
"Started workload on {}:\n{}",
args.host,
// SAFETY(rescrv): serde_json::to_string_pretty should always convert to JSON
// when it just parses as JSON.
uuid,
);
} else {
eprintln!(
"Failed to start workload on {}: {}",
Expand Down

0 comments on commit 35c8fce

Please sign in to comment.