From cfed36582ebd381aa030a5c5752df108a3c904bb Mon Sep 17 00:00:00 2001 From: iris Date: Fri, 17 Jul 2026 01:10:48 +0200 Subject: [PATCH] fix: move matrix_sweep_banner to module scope (items_after_statements) --- hive-c0re/src/main.rs | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index 26a98ec4..a97aff7b 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -197,6 +197,22 @@ async fn main() -> Result<()> { } } +/// Banner message for a failing matrix `ensure_all` sweep, shared by both +/// the initial and periodic `record_err` call sites in `cmd_serve` so the +/// wording can't drift between them. +fn matrix_sweep_banner(ctx: sweep_health::SweepFailure) -> String { + let age = ctx.since_last_ok.map_or_else( + || "no success this session".to_owned(), + |d| format!("last ok {} ago", sweep_health::fmt_age(d)), + ); + format!( + "matrix user/space sweep failing ({} consecutive, {age}) \ + — some agents may be missing matrix accounts, space membership, \ + or chat-room invites", + ctx.consecutive + ) +} + /// Start the coordinator daemon: open the broker, run migrations, spawn /// background tasks (auto-update, vacuums, crash-watcher, reminder-scheduler, /// dashboard), then serve the admin socket until a signal arrives. @@ -401,21 +417,6 @@ async fn cmd_serve( } } }); - /// Banner message for a failing matrix `ensure_all` sweep, shared by - /// both the initial and periodic `record_err` call sites below so the - /// wording can't drift between them. - fn matrix_sweep_banner(ctx: sweep_health::SweepFailure) -> String { - let age = ctx.since_last_ok.map_or_else( - || "no success this session".to_owned(), - |d| format!("last ok {} ago", sweep_health::fmt_age(d)), - ); - format!( - "matrix user/space sweep failing ({} consecutive, {age}) \ - — some agents may be missing matrix accounts, space membership, \ - or chat-room invites", - ctx.consecutive - ) - } // Matrix user sweep: same shape — ensure every container has // an account on the local matrix-tuwunel homeserver with an // access_token persisted to `/matrix-token`. No-op when