Skip to content

Commit

Permalink
impl 2: create a tempdir for the transient files
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Sep 11, 2023
1 parent 9b3a92a commit 51bdb36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7730,9 +7730,13 @@ impl AccountsDb {
let slot = storages.max_slot_inclusive();
let use_bg_thread_pool = config.use_bg_thread_pool;
let accounts_hash_cache_path = self.accounts_hash_cache_path.clone();
let transient_accounts_hash_cache_dir = TempDir::new_in(&accounts_hash_cache_path)
.expect("create transient accounts hash cache dir");
let transient_accounts_hash_cache_path =
transient_accounts_hash_cache_dir.path().to_path_buf();
let scan_and_hash = || {
let (cache_hash_data, cache_hash_data_us) = measure_us!(Self::get_cache_hash_data(
accounts_hash_cache_path.clone(),
accounts_hash_cache_path,
config,
kind,
slot
Expand All @@ -7751,7 +7755,7 @@ impl AccountsDb {
None
},
zero_lamport_accounts: kind.zero_lamport_accounts(),
dir_for_temp_cache_files: accounts_hash_cache_path,
dir_for_temp_cache_files: transient_accounts_hash_cache_path,
active_stats: &self.active_stats,
};

Expand Down

0 comments on commit 51bdb36

Please sign in to comment.