mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
udp: improve code in PendingScrapeResponseSlab.clean
This commit is contained in:
parent
9479828b4a
commit
6cbfa46805
1 changed files with 7 additions and 6 deletions
|
|
@ -110,18 +110,19 @@ impl PendingScrapeResponseSlab {
|
|||
let now = Instant::now();
|
||||
|
||||
self.0.retain(|k, v| {
|
||||
let keep = v.valid_until.0 > now;
|
||||
|
||||
if !keep {
|
||||
if v.valid_until.0 > now {
|
||||
true
|
||||
} else {
|
||||
::log::warn!(
|
||||
"Removing PendingScrapeResponseSlab entry while cleaning. {:?}: {:?}",
|
||||
"Unconsumed PendingScrapeResponseSlab entry. {:?}: {:?}",
|
||||
k,
|
||||
v
|
||||
);
|
||||
}
|
||||
|
||||
keep
|
||||
false
|
||||
}
|
||||
});
|
||||
|
||||
self.0.shrink_to_fit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue