Add Timeout to Status Ping HTTP Request
All checks were successful
Run Tests on Code / run-tests (push) Successful in 14s

This commit is contained in:
Neshura 2024-05-08 16:34:32 +02:00
parent 1b585eab7e
commit 94d8a4e673
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -1,4 +1,4 @@
use crate::{config::{Config}};
use crate::{config::{Config}, HTTP_CLIENT};
use crate::lemmy::{Lemmy};
use crate::post_history::{SeriesHistory};
use chrono::{DateTime, Duration, Utc};
@ -113,7 +113,7 @@ impl Bot {
async fn ping_status(&self) {
let read_config = &self.shared_config.read().expect("Read Lock Failed").clone();
if let Some(status_url) = &read_config.status_post_url {
match reqwest::get(status_url).await {
match HTTP_CLIENT.get(status_url).send().await {
Ok(_) => {},
Err(e) => {
let err_msg = format!("While pinging status URL: {e}");