Add Timeout to Status Ping HTTP Request
All checks were successful
Run Tests on Code / run-tests (push) Successful in 14s
All checks were successful
Run Tests on Code / run-tests (push) Successful in 14s
This commit is contained in:
parent
1b585eab7e
commit
94d8a4e673
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
use crate::{config::{Config}};
|
use crate::{config::{Config}, HTTP_CLIENT};
|
||||||
use crate::lemmy::{Lemmy};
|
use crate::lemmy::{Lemmy};
|
||||||
use crate::post_history::{SeriesHistory};
|
use crate::post_history::{SeriesHistory};
|
||||||
use chrono::{DateTime, Duration, Utc};
|
use chrono::{DateTime, Duration, Utc};
|
||||||
|
@ -113,7 +113,7 @@ impl Bot {
|
||||||
async fn ping_status(&self) {
|
async fn ping_status(&self) {
|
||||||
let read_config = &self.shared_config.read().expect("Read Lock Failed").clone();
|
let read_config = &self.shared_config.read().expect("Read Lock Failed").clone();
|
||||||
if let Some(status_url) = &read_config.status_post_url {
|
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(_) => {},
|
Ok(_) => {},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let err_msg = format!("While pinging status URL: {e}");
|
let err_msg = format!("While pinging status URL: {e}");
|
||||||
|
|
Loading…
Reference in a new issue