add option to only clear splistore keys
This commit is contained in:
parent
a768dd84fa
commit
db6b7b91d8
@ -128,6 +128,10 @@ var splitstoreClearCmd = &cli.Command{
|
|||||||
Name: "repo",
|
Name: "repo",
|
||||||
Value: "~/.lotus",
|
Value: "~/.lotus",
|
||||||
},
|
},
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "keys-only",
|
||||||
|
Usage: "only delete splitstore keys",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
r, err := repo.NewFS(cctx.String("repo"))
|
r, err := repo.NewFS(cctx.String("repo"))
|
||||||
@ -163,10 +167,12 @@ var splitstoreClearCmd = &cli.Command{
|
|||||||
return xerrors.Errorf("splitstore is not enabled")
|
return xerrors.Errorf("splitstore is not enabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("clearing splitstore directory...")
|
if !cctx.Bool("keys-only") {
|
||||||
err = clearSplitstoreDir(lr)
|
fmt.Println("clearing splitstore directory...")
|
||||||
if err != nil {
|
err = clearSplitstoreDir(lr)
|
||||||
return xerrors.Errorf("error clearing splitstore directory: %w", err)
|
if err != nil {
|
||||||
|
return xerrors.Errorf("error clearing splitstore directory: %w", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("deleting splitstore keys from metadata datastore...")
|
fmt.Println("deleting splitstore keys from metadata datastore...")
|
||||||
|
Loading…
Reference in New Issue
Block a user