Skip to content

Commit

Permalink
no exit on complete but increase sleep time
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaguilar committed Sep 15, 2023
1 parent 18e92af commit 6f5f64b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl APIClient {
"Token",
reqwest::header::HeaderValue::from_str(self.token.as_str()).unwrap(),
);
let mut waittime = 30;
loop {
let headers = token_header.clone();

Expand Down Expand Up @@ -97,9 +98,10 @@ impl APIClient {

if !response.is_complete() {
println!("workflow is still running");
waittime = 30;
} else {
println!("workflow is {}", response.data[0].current_state);
break;
waittime = 600;
}
} else {
println!("status query failed with {}", response.status_info.message);
Expand All @@ -108,7 +110,7 @@ impl APIClient {
break;
}
}
thread::sleep(Duration::from_secs(30));
thread::sleep(Duration::from_secs(waittime));
}
Ok(())
}
Expand Down

0 comments on commit 6f5f64b

Please sign in to comment.