Use Arc instead of &Arc in SnapshotPackagerService::new (#31270)

This commit is contained in:
Brooks 2023-04-19 11:09:49 -04:00 committed by GitHub
parent 8162358b8b
commit 1d14156832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 12 deletions

View File

@ -34,13 +34,11 @@ impl SnapshotPackagerService {
snapshot_package_sender: Sender<SnapshotPackage>, snapshot_package_sender: Sender<SnapshotPackage>,
snapshot_package_receiver: Receiver<SnapshotPackage>, snapshot_package_receiver: Receiver<SnapshotPackage>,
starting_snapshot_hashes: Option<StartingSnapshotHashes>, starting_snapshot_hashes: Option<StartingSnapshotHashes>,
exit: &Arc<AtomicBool>, exit: Arc<AtomicBool>,
cluster_info: &Arc<ClusterInfo>, cluster_info: Arc<ClusterInfo>,
snapshot_config: SnapshotConfig, snapshot_config: SnapshotConfig,
enable_gossip_push: bool, enable_gossip_push: bool,
) -> Self { ) -> Self {
let exit = exit.clone();
let cluster_info = cluster_info.clone();
let max_full_snapshot_hashes = std::cmp::min( let max_full_snapshot_hashes = std::cmp::min(
MAX_LEGACY_SNAPSHOT_HASHES, MAX_LEGACY_SNAPSHOT_HASHES,
snapshot_config snapshot_config

View File

@ -693,8 +693,8 @@ impl Validator {
snapshot_package_sender.clone(), snapshot_package_sender.clone(),
snapshot_package_receiver, snapshot_package_receiver,
starting_snapshot_hashes, starting_snapshot_hashes,
&exit, exit.clone(),
&cluster_info, cluster_info.clone(),
config.snapshot_config.clone(), config.snapshot_config.clone(),
enable_gossip_push, enable_gossip_push,
); );

View File

@ -184,8 +184,8 @@ impl BackgroundServices {
snapshot_package_sender.clone(), snapshot_package_sender.clone(),
snapshot_package_receiver, snapshot_package_receiver,
None, None,
&exit, exit.clone(),
&cluster_info, cluster_info.clone(),
snapshot_config.clone(), snapshot_config.clone(),
false, false,
); );

View File

@ -509,8 +509,8 @@ fn test_concurrent_snapshot_packaging(
snapshot_package_sender.clone(), snapshot_package_sender.clone(),
snapshot_package_receiver, snapshot_package_receiver,
None, None,
&exit, exit.clone(),
&cluster_info, cluster_info,
snapshot_config.clone(), snapshot_config.clone(),
true, true,
); );
@ -991,8 +991,8 @@ fn test_snapshots_with_background_services(
snapshot_package_sender.clone(), snapshot_package_sender.clone(),
snapshot_package_receiver, snapshot_package_receiver,
None, None,
&exit, exit.clone(),
&cluster_info, cluster_info.clone(),
snapshot_test_config.snapshot_config.clone(), snapshot_test_config.snapshot_config.clone(),
false, false,
); );