feat: sort DNS results by successful connection timestamp (#5818)

This commit is contained in:
link2xt
2024-08-02 16:53:16 +00:00
committed by GitHub
parent 642eaf92d7
commit 094d310f5c
7 changed files with 548 additions and 139 deletions

View File

@@ -18,6 +18,8 @@ use crate::imex::BLOBS_BACKUP_NAME;
use crate::location::delete_orphaned_poi_locations;
use crate::log::LogExt;
use crate::message::{Message, MsgId, Viewtype};
use crate::net::dns::prune_dns_cache;
use crate::net::prune_connection_history;
use crate::param::{Param, Params};
use crate::peerstate::Peerstate;
use crate::stock_str;
@@ -787,6 +789,17 @@ pub async fn housekeeping(context: &Context) -> Result<()> {
.log_err(context)
.ok();
prune_connection_history(context)
.await
.context("Failed to prune connection history")
.log_err(context)
.ok();
prune_dns_cache(context)
.await
.context("Failed to prune DNS cache")
.log_err(context)
.ok();
// Delete POI locations
// which don't have corresponding message.
delete_orphaned_poi_locations(context)