Use Arc instead of &Arc in AccountsBackgroundService::new (#31268)

This commit is contained in:
Brooks 2023-04-19 11:10:41 -04:00 committed by GitHub
parent 80b27f3cd9
commit ca1bde3591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 deletions

View File

@ -734,7 +734,7 @@ impl Validator {
let last_full_snapshot_slot = starting_snapshot_hashes.map(|x| x.full.0 .0);
let accounts_background_service = AccountsBackgroundService::new(
bank_forks.clone(),
&exit,
exit.clone(),
AbsRequestHandlers {
snapshot_request_handler,
pruned_banks_request_handler,

View File

@ -217,7 +217,7 @@ impl BackgroundServices {
};
let accounts_background_service = AccountsBackgroundService::new(
bank_forks,
&exit,
exit.clone(),
AbsRequestHandlers {
snapshot_request_handler,
pruned_banks_request_handler,

View File

@ -1009,8 +1009,13 @@ fn test_snapshots_with_background_services(
snapshot_test_config.snapshot_config.clone(),
);
let accounts_background_service =
AccountsBackgroundService::new(bank_forks.clone(), &exit, abs_request_handler, false, None);
let accounts_background_service = AccountsBackgroundService::new(
bank_forks.clone(),
exit.clone(),
abs_request_handler,
false,
None,
);
let mut last_full_snapshot_slot = None;
let mut last_incremental_snapshot_slot = None;

View File

@ -1282,7 +1282,7 @@ fn load_bank_forks(
let exit = Arc::new(AtomicBool::new(false));
let accounts_background_service = AccountsBackgroundService::new(
bank_forks.clone(),
&exit,
exit.clone(),
abs_request_handler,
process_options.accounts_db_test_hash_calculation,
None,

View File

@ -529,12 +529,11 @@ pub struct AccountsBackgroundService {
impl AccountsBackgroundService {
pub fn new(
bank_forks: Arc<RwLock<BankForks>>,
exit: &Arc<AtomicBool>,
exit: Arc<AtomicBool>,
request_handlers: AbsRequestHandlers,
test_hash_calculation: bool,
mut last_full_snapshot_slot: Option<Slot>,
) -> Self {
let exit = exit.clone();
let mut last_cleaned_block_height = 0;
let mut removed_slots_count = 0;
let mut total_remove_slots_time = 0;