mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 10:01:17 +00:00
Delete full db directory with purge-chain subcommand (#1786)
Closes #1767 Until now the `purge-chain` command would only remove the `full` subfolder of the db folder. However there is also the `parachains` db that currently remains and can cause problems on node restart. Example wiht old code: ``` polkadot purge-chain --database paritydb --base-path /tmp/some-folder Are you sure to remove "/tmp/some-folder/chains/polkadot/paritydb/full"? [y/N]: y "/tmp/some-folder/chains/polkadot/paritydb/full" removed. ``` In this case `/tmp/some-folder/chains/polkadot/paritydb/parachains` would remain and might cause problem on node restart because of version conflicts as described in #1767. After this PR the whole `/tmp/some-folder/chains/polkadot/paritydb` folder will be deleted.
This commit is contained in:
@@ -48,7 +48,7 @@ pub struct PurgeChainCmd {
|
||||
impl PurgeChainCmd {
|
||||
/// Run the purge command
|
||||
pub fn run(&self, database_config: DatabaseSource) -> error::Result<()> {
|
||||
let db_path = database_config.path().ok_or_else(|| {
|
||||
let db_path = database_config.path().and_then(|p| p.parent()).ok_or_else(|| {
|
||||
error::Error::Input("Cannot purge custom database implementation".into())
|
||||
})?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user