feat: Remove hidden relays automatically (#8402)

Automatically remove relays that are hidden (`is_published=0`) and
haven't been used to receive new messages for over 90 days.

Closes: #8384

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
Jagoda Estera Ślązak
2026-07-15 12:31:11 +00:00
committed by GitHub
parent 94fc4f7550
commit 5d0e5efc94
6 changed files with 196 additions and 2 deletions
+7
View File
@@ -1182,6 +1182,7 @@ impl Session {
for (request_uids, set) in build_sequence_sets(&request_uids)? {
info!(context, "Starting UID FETCH of message set \"{}\".", set);
let transport_id = self.transport_id();
let mut fetch_responses = self
.uid_fetch(&set, BODY_FULL)
.await
@@ -1277,6 +1278,12 @@ impl Session {
"Passing message UID {} to receive_imf().", request_uid
);
let res = receive_imf_inner(context, rfc724_mid, body, is_seen).await;
crate::sql::update_transport_last_rcvd_timestamp(context, transport_id)
.await
.context(format!(
"Failed to update last_rcvd_timestamp of transport {}",
transport_id
))?;
// If there was an error receiving the message, show a device message:
let received_msg = match res {