mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: Should use fallback when there is no hl-node files
This commit is contained in:
@ -100,12 +100,16 @@ impl BlockSource for HlNodeBlockSource {
|
|||||||
"No EVM blocks from hl-node found at {:?}; fallback to s3/ingest-dir",
|
"No EVM blocks from hl-node found at {:?}; fallback to s3/ingest-dir",
|
||||||
self.local_ingest_dir
|
self.local_ingest_dir
|
||||||
);
|
);
|
||||||
return None;
|
return self.fallback.find_latest_block_number().await;
|
||||||
};
|
};
|
||||||
let mut file = File::open(&dir).expect("Failed to open hour file path");
|
let mut file = File::open(&dir).expect("Failed to open hour file path");
|
||||||
let last_line = read_last_complete_line(&mut file);
|
let last_line = read_last_complete_line(&mut file);
|
||||||
let Ok((_, height)) = line_to_evm_block(&last_line) else {
|
let Ok((_, height)) = line_to_evm_block(&last_line) else {
|
||||||
return None;
|
warn!(
|
||||||
|
"Failed to parse the hl-node hourly file at {:?}; fallback to s3/ingest-dir",
|
||||||
|
file
|
||||||
|
);
|
||||||
|
return self.fallback.find_latest_block_number().await;
|
||||||
};
|
};
|
||||||
|
|
||||||
info!("Latest block number: {} with path {}", height, dir.display());
|
info!("Latest block number: {} with path {}", height, dir.display());
|
||||||
|
|||||||
Reference in New Issue
Block a user