Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sambley authored and mvines committed Jun 18, 2019
1 parent 7fd879b commit 07c183b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions multinode-demo/fullnode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions runtime/src/append_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand All @@ -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));
Expand Down

0 comments on commit 07c183b

Please sign in to comment.