This commit is contained in:
Sathish Ambley 2019-06-10 22:55:56 -07:00 committed by Michael Vines
parent 7fd879b417
commit 07c183bb84
2 changed files with 10 additions and 9 deletions

View File

@ -484,10 +484,9 @@ while true; do
if [[ -d $snapshot_config_dir ]]; then
$rsync -qrt --delete-after "$snapshot_config_dir"/ "$SOLANA_RSYNC_CONFIG_DIR"/snapshots
$rsync -qrt --delete-after "$accounts_config_dir"/ "$SOLANA_RSYNC_CONFIG_DIR"/accounts
# $rsync -qrt --delete-after "$ledger_config_dir"/ "$SOLANA_RSYNC_CONFIG_DIR"/ledger
fi
) || true
secs_to_next_sync_poll=30
secs_to_next_sync_poll=60
done
else
secs_to_next_genesis_poll=1

View File

@ -360,12 +360,14 @@ impl<'a> serde::de::Visitor<'a> for AppendVecVisitor {
let split_path: Vec<&str> = path.to_str().unwrap().rsplit('/').collect();
let account_paths = ACCOUNT_PATHS.lock().unwrap().clone();
let mut account_path = path.clone();
for dir_path in account_paths.iter() {
let fullpath = format!("{}/{}/{}", dir_path, split_path[1], split_path[0]);
let file_path = Path::new(&fullpath);
if file_path.exists() {
account_path = file_path.to_path_buf();
break;
if split_path.len() >= 2 {
for dir_path in account_paths.iter() {
let fullpath = format!("{}/{}/{}", dir_path, split_path[1], split_path[0]);
let file_path = Path::new(&fullpath);
if file_path.exists() {
account_path = file_path.to_path_buf();
break;
}
}
}
@ -376,7 +378,7 @@ impl<'a> serde::de::Visitor<'a> for AppendVecVisitor {
.open(account_path.as_path());
if data.is_err() {
warn!("account open {:?} failed, create empty", account_path);
warn!("account open {:?} failed", account_path);
std::fs::create_dir_all(&account_path.parent().unwrap())
.expect("Create directory failed");
return Ok(AppendVec::new(&account_path, true, file_size as usize));