Skip to content

Commit

Permalink
Merge pull request #12 from jeromerobert/main
Browse files Browse the repository at this point in the history
Better log message when Woodpecker token is wrong
  • Loading branch information
windsource authored Jul 8, 2024
2 parents 1d9b4fd + b358366 commit a60f364
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ async fn main() -> Result<(), Error> {
let client = reqwest::Client::new();

loop {
let response = client
let content = client
.get(&request_url)
.bearer_auth(&wp_token)
.send()
.await?
.bytes()
.await?;

let wp_queue_info: WpQueueInfo = response.json().await?;
let Ok(wp_queue_info) = serde_json::from_slice::<WpQueueInfo>(&content) else {
error!("Cannot decode JSON from {request_url}: {content:?}");
process::exit(1);
};

strategy.apply(&wp_queue_info).await;

Expand Down

0 comments on commit a60f364

Please sign in to comment.