codemod --extensions rs get_snapshot_tar_path get_snapshot_archive_path

This commit is contained in:
Michael Vines
2020-01-23 11:22:37 -07:00
parent ce231602dc
commit b045f9a50d
7 changed files with 22 additions and 15 deletions

View File

@ -192,7 +192,7 @@ impl BankForks {
root,
&root_bank.src.roots(),
snapshot_package_sender.as_ref().unwrap(),
snapshot_utils::get_snapshot_tar_path(&config.snapshot_package_output_path),
snapshot_utils::get_snapshot_archive_path(&config.snapshot_package_output_path),
);
if r.is_err() {
warn!("Error generating snapshot for bank: {}, err: {:?}", root, r);

View File

@ -26,8 +26,9 @@ pub fn load(
fs::create_dir_all(&snapshot_config.snapshot_path)
.expect("Couldn't create snapshot directory");
let tar =
snapshot_utils::get_snapshot_tar_path(&snapshot_config.snapshot_package_output_path);
let tar = snapshot_utils::get_snapshot_archive_path(
&snapshot_config.snapshot_package_output_path,
);
if tar.exists() {
info!("Loading snapshot package: {:?}", tar);
// Fail hard here if snapshot fails to load, don't silently continue

View File

@ -481,7 +481,7 @@ pub fn bank_from_archive<P: AsRef<Path>>(
Ok(bank)
}
pub fn get_snapshot_tar_path<P: AsRef<Path>>(snapshot_output_dir: P) -> PathBuf {
pub fn get_snapshot_archive_path<P: AsRef<Path>>(snapshot_output_dir: P) -> PathBuf {
snapshot_output_dir.as_ref().join("snapshot.tar.bz2")
}