feat(worker): add FederationManagementHandler and wire into event loop

This commit is contained in:
2026-05-28 02:30:22 +02:00
parent 0dce4fbe64
commit a06d09c101
3 changed files with 30 additions and 4 deletions

View File

@@ -52,8 +52,9 @@ async fn main() {
let n = infra.handlers.notification.handle(event).await;
let f = infra.handlers.federation.handle(event).await;
let fm = infra.handlers.federation_management.handle(event).await;
if n.is_ok() && f.is_ok() {
if n.is_ok() && f.is_ok() && fm.is_ok() {
(envelope.ack)();
tracing::info!(event_type, "event handled ok");
} else {
@@ -63,6 +64,9 @@ async fn main() {
if let Err(e) = &f {
tracing::error!("federation handler: {e}");
}
if let Err(e) = &fm {
tracing::error!("federation management handler: {e}");
}
// Last delivery attempt -> move to DLQ then ack.
// Earlier attempts -> nack so NATS retries.
@@ -70,6 +74,7 @@ async fn main() {
let error_msg = n
.err()
.or(f.err())
.or(fm.err())
.map(|e| e.to_string())
.unwrap_or_else(|| "unknown error".into());