feat: Add method to flush senders when a server becomes active

This commit is contained in:
timedout
2026-02-26 16:16:45 +00:00
parent 052c4dfa21
commit 5e3174493d
3 changed files with 65 additions and 4 deletions
+9 -1
View File
@@ -4,7 +4,7 @@ use axum_extra::{
headers::{Authorization, authorization::Bearer},
typed_header::TypedHeaderRejectionReason,
};
use conduwuit::{Err, Error, Result, debug_error, err, warn};
use conduwuit::{Err, Error, Result, debug_error, debug_info, err, warn};
use futures::{
TryFutureExt,
future::{
@@ -329,6 +329,14 @@ async fn auth_server(
return Err!(Request(Forbidden("Failed to verify X-Matrix signatures.")));
}
if services.sending.server_is_offline(destination).await {
debug_info!(?destination, "server returned from being offline");
services
.sending
.mark_server_online(destination, false)
.await;
}
Ok(Auth {
origin: origin.to_owned().into(),
sender_user: None,