Compare commits
2 commits
main
...
nex/experi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f5ffd8676 | ||
|
|
dbe024f645 |
2 changed files with 31 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
use std::{
|
use std::{
|
||||||
|
env::args,
|
||||||
iter::once,
|
iter::once,
|
||||||
sync::{
|
sync::{
|
||||||
Arc, OnceLock,
|
Arc, OnceLock,
|
||||||
|
|
@ -18,7 +19,7 @@ use tokio::runtime::Builder;
|
||||||
|
|
||||||
use crate::{clap::Args, server::Server};
|
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_MIN: usize = 2;
|
||||||
const WORKER_KEEPALIVE: u64 = 36;
|
const WORKER_KEEPALIVE: u64 = 36;
|
||||||
const MAX_BLOCKING_THREADS: usize = 1024;
|
const MAX_BLOCKING_THREADS: usize = 1024;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use std::{fmt::Debug, mem, sync::Arc};
|
use std::{fmt::Debug, mem, sync::Arc};
|
||||||
|
|
||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
use conduwuit::utils::response::LimitReadExt;
|
use conduwuit::{debug, debug_info, utils::response::LimitReadExt};
|
||||||
use conduwuit_core::{
|
use conduwuit_core::{
|
||||||
Err, Event, Result, debug_warn, err, trace,
|
Err, Event, Result, debug_warn, err, trace,
|
||||||
utils::{stream::TryIgnore, string_from_bytes},
|
utils::{stream::TryIgnore, string_from_bytes},
|
||||||
|
|
@ -220,7 +220,13 @@ impl Service {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
match response {
|
||||||
| Ok(mut response) => {
|
| Ok(mut response) => {
|
||||||
|
|
@ -490,9 +496,28 @@ impl Service {
|
||||||
.await
|
.await
|
||||||
.ok();
|
.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))
|
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(())
|
Ok(())
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue