Fix test
This commit is contained in:
parent
7fd879b417
commit
07c183bb84
|
@ -484,10 +484,9 @@ while true; do
|
||||||
if [[ -d $snapshot_config_dir ]]; then
|
if [[ -d $snapshot_config_dir ]]; then
|
||||||
$rsync -qrt --delete-after "$snapshot_config_dir"/ "$SOLANA_RSYNC_CONFIG_DIR"/snapshots
|
$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 "$accounts_config_dir"/ "$SOLANA_RSYNC_CONFIG_DIR"/accounts
|
||||||
# $rsync -qrt --delete-after "$ledger_config_dir"/ "$SOLANA_RSYNC_CONFIG_DIR"/ledger
|
|
||||||
fi
|
fi
|
||||||
) || true
|
) || true
|
||||||
secs_to_next_sync_poll=30
|
secs_to_next_sync_poll=60
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
secs_to_next_genesis_poll=1
|
secs_to_next_genesis_poll=1
|
||||||
|
|
|
@ -360,12 +360,14 @@ impl<'a> serde::de::Visitor<'a> for AppendVecVisitor {
|
||||||
let split_path: Vec<&str> = path.to_str().unwrap().rsplit('/').collect();
|
let split_path: Vec<&str> = path.to_str().unwrap().rsplit('/').collect();
|
||||||
let account_paths = ACCOUNT_PATHS.lock().unwrap().clone();
|
let account_paths = ACCOUNT_PATHS.lock().unwrap().clone();
|
||||||
let mut account_path = path.clone();
|
let mut account_path = path.clone();
|
||||||
for dir_path in account_paths.iter() {
|
if split_path.len() >= 2 {
|
||||||
let fullpath = format!("{}/{}/{}", dir_path, split_path[1], split_path[0]);
|
for dir_path in account_paths.iter() {
|
||||||
let file_path = Path::new(&fullpath);
|
let fullpath = format!("{}/{}/{}", dir_path, split_path[1], split_path[0]);
|
||||||
if file_path.exists() {
|
let file_path = Path::new(&fullpath);
|
||||||
account_path = file_path.to_path_buf();
|
if file_path.exists() {
|
||||||
break;
|
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());
|
.open(account_path.as_path());
|
||||||
|
|
||||||
if data.is_err() {
|
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())
|
std::fs::create_dir_all(&account_path.parent().unwrap())
|
||||||
.expect("Create directory failed");
|
.expect("Create directory failed");
|
||||||
return Ok(AppendVec::new(&account_path, true, file_size as usize));
|
return Ok(AppendVec::new(&account_path, true, file_size as usize));
|
||||||
|
|
Loading…
Reference in New Issue