mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
fix: check if dir exists before removing (#16968)
This commit is contained in:
@@ -274,9 +274,11 @@ impl<R, ChainSpec: EthChainSpec> LaunchContextWith<Attached<WithConfigs<ChainSpe
|
||||
pub fn ensure_etl_datadir(mut self) -> Self {
|
||||
if self.toml_config_mut().stages.etl.dir.is_none() {
|
||||
let etl_path = EtlConfig::from_datadir(self.data_dir().data_dir());
|
||||
// Remove etl-path files on launch
|
||||
if let Err(err) = fs::remove_dir_all(&etl_path) {
|
||||
warn!(target: "reth::cli", ?etl_path, %err, "Failed to remove ETL path on launch");
|
||||
if etl_path.exists() {
|
||||
// Remove etl-path files on launch
|
||||
if let Err(err) = fs::remove_dir_all(&etl_path) {
|
||||
warn!(target: "reth::cli", ?etl_path, %err, "Failed to remove ETL path on launch");
|
||||
}
|
||||
}
|
||||
self.toml_config_mut().stages.etl.dir = Some(etl_path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user