Avoid cfg lookup on chain remove since unenabled splitstore delete is noop anyway (#11916)
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
This commit is contained in:
parent
70e0767acf
commit
95b6483ad9
@ -661,23 +661,11 @@ func removeExistingChain(cctx *cli.Context, lr repo.Repo) error {
|
||||
}
|
||||
}()
|
||||
|
||||
cfg, err := lockedRepo.Config()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error getting config: %w", err)
|
||||
}
|
||||
|
||||
fullNodeConfig, ok := cfg.(*config.FullNode)
|
||||
if !ok {
|
||||
return xerrors.Errorf("wrong config type: %T", cfg)
|
||||
}
|
||||
|
||||
if fullNodeConfig.Chainstore.EnableSplitstore {
|
||||
log.Info("removing splitstore directory...")
|
||||
err = deleteSplitstoreDir(lockedRepo)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error removing splitstore directory: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Get the base repo path
|
||||
repoPath := lockedRepo.Path()
|
||||
|
Loading…
Reference in New Issue
Block a user