Reduced connection timeouts and added some logging
Some checks failed
Run Tests on Code / run-tests (push) Has been cancelled
Some checks failed
Run Tests on Code / run-tests (push) Has been cancelled
This commit is contained in:
parent
22bbaaa002
commit
cd78d3c1c7
3 changed files with 6 additions and 4 deletions
|
@ -102,6 +102,8 @@ pub(crate) async fn run() {
|
|||
|
||||
let series = config.series.clone();
|
||||
for series in series {
|
||||
let info_msg = format!("Handling Series {}", series.slug);
|
||||
info!(info_msg);
|
||||
if handle_series(&series, &communities, &lemmy, &config, &mut post_history)
|
||||
.await
|
||||
.is_err()
|
||||
|
|
|
@ -215,7 +215,7 @@ impl Lemmy {
|
|||
match serde_json::from_str::<T>(response) {
|
||||
Ok(data) => Ok(data),
|
||||
Err(e) => {
|
||||
let err_msg = format!("{e}");
|
||||
let err_msg = format!("{e} while parsing JSON");
|
||||
error!(err_msg);
|
||||
Err(())
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ impl Lemmy {
|
|||
match serde_json::from_str::<HashMap<&str, T>>(response) {
|
||||
Ok(mut data) => Ok(data.remove("post_view").expect("Element should be present")),
|
||||
Err(e) => {
|
||||
let err_msg = format!("{e}");
|
||||
let err_msg = format!("{e} while parsing JSON HashMap");
|
||||
error!(err_msg);
|
||||
Err(())
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ mod fetchers;
|
|||
|
||||
pub static HTTP_CLIENT: Lazy<Client> = Lazy::new(|| {
|
||||
Client::builder()
|
||||
.timeout(Duration::seconds(30).to_std().unwrap())
|
||||
.connect_timeout(Duration::seconds(30).to_std().unwrap())
|
||||
.timeout(Duration::seconds(10).to_std().unwrap())
|
||||
.connect_timeout(Duration::seconds(10).to_std().unwrap())
|
||||
.build()
|
||||
.expect("build client")
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue