Skip to content

Commit

Permalink
Use is_disk_index_enabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Dec 9, 2024
1 parent e16403d commit e1dd4c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion accounts-db/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndex<T, U> {
// this assumes the largest bin contains twice the expected amount of the average size per bin
let bins = self.bins();
let expected_items_per_bin = approx_items_len * 2 / bins;
let use_disk = self.storage.storage.disk.is_some();
let use_disk = self.storage.storage.is_disk_index_enabled();
let mut binned = (0..bins)
.map(|_| Vec::with_capacity(expected_items_per_bin))
.collect::<Vec<_>>();
Expand Down
4 changes: 2 additions & 2 deletions accounts-db/src/bucket_map_holder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> BucketMapHolder<T, U>
/// return when the bg threads have reached an 'idle' state
pub fn wait_for_idle(&self) {
assert!(self.get_startup());
if self.disk.is_none() {
if !self.is_disk_index_enabled() {
return;
}

Expand Down Expand Up @@ -315,7 +315,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> BucketMapHolder<T, U>
can_advance_age: bool,
) {
let bins = in_mem.len();
let flush = self.disk.is_some();
let flush = self.is_disk_index_enabled();
let mut throttling_wait_ms = None;
loop {
if !flush {
Expand Down

0 comments on commit e1dd4c3

Please sign in to comment.