Compare commits

...

2 Commits

Author SHA1 Message Date
timedout
0f5ffd8676 fix: Helps when you refer to variables that exist 2026-03-09 16:43:09 +00:00
timedout
dbe024f645 feat: Add debug logs to pusher service 2026-03-09 16:37:51 +00:00
2 changed files with 31 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
use std::{
env::args,
iter::once,
sync::{
Arc, OnceLock,
@@ -18,7 +19,7 @@
use crate::{clap::Args, server::Server};
const WORKER_NAME: &str = "conduwuit:worker";
const WORKER_NAME: &str = "c10y:worker";
const WORKER_MIN: usize = 2;
const WORKER_KEEPALIVE: u64 = 36;
const MAX_BLOCKING_THREADS: usize = 1024;

View File

@@ -1,7 +1,7 @@
use std::{fmt::Debug, mem, sync::Arc};
use bytes::BytesMut;
use conduwuit::utils::response::LimitReadExt;
use conduwuit::{debug, debug_info, utils::response::LimitReadExt};
use conduwuit_core::{
Err, Event, Result, debug_warn, err, trace,
utils::{stream::TryIgnore, string_from_bytes},
@@ -220,7 +220,13 @@ pub async fn send_request<T>(&self, dest: &str, request: T) -> Result<T::Incomin
}
}
let response = self.services.client.pusher.execute(reqwest_request).await;
let response = self
.services
.client
.pusher
.execute(reqwest_request)
.await
.inspect(|r| debug!("Received response from push gateway {dest}: {r:?}"));
match response {
| Ok(mut response) => {
@@ -490,9 +496,28 @@ async fn send_notice<E>(
.await
.ok();
}
debug_info!(
%url,
?notify,
?event,
"Sending notification to push gateway for {} in {}",
event.event_id(),
event.room_id_or_hash(),
);
self.send_request(&http.url, send_event_notification::v1::Request::new(notify))
.await?;
.await
.inspect(|_| {
debug_info!(
"Successfully sent push notification for {}",
event.event_id()
)
})
.inspect_err(|e| {
debug_warn!(
"Failed to send push notification for {}: {e}",
event.event_id()
)
})?;
Ok(())
},