From 94d8a4e6733bb5f84aa2e37598c32c5c07471789 Mon Sep 17 00:00:00 2001 From: Neshura Date: Wed, 8 May 2024 16:34:32 +0200 Subject: [PATCH] Add Timeout to Status Ping HTTP Request --- src/bot.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bot.rs b/src/bot.rs index 6a2890f..ba0e8b9 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -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}");