Pārlūkot izejas kodu

Uses should_evict_based_on_age() in gather_possible_evictions() (#9161)

Brooks 17 stundas atpakaļ
vecāks
revīzija
43ac2f39d7

+ 1 - 1
accounts-db/src/accounts_index/in_mem_accounts_index.rs

@@ -874,7 +874,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> InMemAccountsIndex<T,
         let mut candidates_to_flush = Vec::new();
         let mut candidates_to_evict = Vec::new();
         for (k, v) in iter {
-            if current_age.wrapping_sub(v.age()) > ages_flushing_now {
+            if !Self::should_evict_based_on_age(current_age, v, ages_flushing_now) {
                 // not planning to evict this item from memory within 'ages_flushing_now' ages
                 continue;
             }