mirror of
https://codeberg.org/icewind/rss-webhook-trigger.git
synced 2026-06-03 18:04:09 +02:00
more logging
This commit is contained in:
parent
c394847289
commit
482911ebca
3 changed files with 6 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ use std::hash::{Hash, Hasher};
|
|||
use tokio::time::sleep;
|
||||
use tokio::signal::ctrl_c;
|
||||
use tokio::select;
|
||||
use log::debug;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
|
|
@ -54,9 +55,11 @@ async fn main_loop(config: Config) {
|
|||
let mut req = fetcher.client.post(&feed.hook);
|
||||
for (key, value) in &feed.headers {
|
||||
req = req.header(key, value);
|
||||
debug!("setting header '{}' = '{}'", key, value);
|
||||
}
|
||||
if !feed.body.is_null() {
|
||||
req = req.json(&feed.body);
|
||||
debug!("setting body '{:?}'", feed.body);
|
||||
}
|
||||
if let Err(e) = req.send().await.and_then(|res| res.error_for_status()) {
|
||||
eprintln!("{:#}", e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue