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 2, 2024
1 parent 444a2cf commit d204469
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 d204469

Please sign in to comment.