Skip to content

Commit 49e1d41

Browse files
committed
Improve(format): support specify the number of concurrent for formatting.
Signed-off-by: Wine93 <[email protected]>
1 parent f39dbcd commit 49e1d41

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cli/command/format.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ type formatOptions struct {
6060
filename string
6161
showStatus bool
6262
stopFormat bool
63+
concurrent uint
6364
}
6465

6566
func NewFormatCommand(curveadm *cli.CurveAdm) *cobra.Command {
@@ -80,6 +81,7 @@ func NewFormatCommand(curveadm *cli.CurveAdm) *cobra.Command {
8081
flags.StringVarP(&options.filename, "formatting", "f", "format.yaml", "Specify the configure file for formatting chunkfile pool")
8182
flags.BoolVar(&options.showStatus, "status", false, "Show formatting status")
8283
flags.BoolVar(&options.stopFormat, "stop", false, "Stop formatting progress")
84+
flags.UintVarP(&options.concurrent, "concurrent", "c", 10, "Specify the number of concurrent for formatting")
8385

8486
return cmd
8587
}
@@ -108,6 +110,7 @@ func genFormatPlaybook(curveadm *cli.CurveAdm,
108110
Type: step,
109111
Configs: fcs,
110112
ExecOptions: playbook.ExecOptions{
113+
Concurrency: options.concurrent,
111114
SilentSubBar: options.showStatus,
112115
},
113116
})

0 commit comments

Comments
 (0)