mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-08-29 07:08:42 +00:00
Fix #794: Proper route request cache cleanup
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
@@ -60,12 +60,13 @@ impl RouteRequestCache {
|
||||
trace!("Cleaning route request cache");
|
||||
|
||||
cache.retain(|subnet, info: &mut RouteRequestInfo| {
|
||||
if info.sent.elapsed() < expiration {
|
||||
false
|
||||
} else {
|
||||
let elapsed = info.sent.elapsed() >= expiration;
|
||||
|
||||
if elapsed {
|
||||
trace!(%subnet, "Removing exired route request from cache");
|
||||
true
|
||||
}
|
||||
|
||||
!elapsed
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user