codemod --extensions rs get_snapshot_tar_path get_snapshot_archive_path
This commit is contained in:
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user