Skip to content

Commit d61ac0c

Browse files
authored
Merge pull request #671 from 0chain/feat/set-batchsize
Add option to set repair batch size
2 parents 8825d98 + 286f7ff commit d61ac0c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cmd/repair.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ var startRepair = &cobra.Command{
3838
}
3939
localRootPath := cmd.Flag("rootpath").Value.String()
4040
repairPath := cmd.Flag("repairpath").Value.String()
41+
repairBatchSize, _ := cmd.Flags().GetInt("repairbatchsize")
42+
sdk.RepairBatchSize = repairBatchSize
43+
sdk.SetMultiOpBatchSize(repairBatchSize)
4144

4245
wg := &sync.WaitGroup{}
4346
statusBar := &StatusBar{wg: wg}
@@ -63,10 +66,10 @@ var repairSize = &cobra.Command{
6366
Long: `gets only size to repair file to blobbers`,
6467
Args: cobra.MinimumNArgs(0),
6568
Run: func(cmd *cobra.Command, args []string) {
66-
fflags := cmd.Flags()
67-
if !fflags.Changed("allocation") {
69+
fflags := cmd.Flags()
70+
if !fflags.Changed("allocation") {
6871
PrintError("Error: allocation flag is missing")
69-
os.Exit(1)
72+
os.Exit(1)
7073
}
7174

7275
repairPath := "/"
@@ -106,6 +109,7 @@ func init() {
106109
startRepair.PersistentFlags().String("allocation", "", "Allocation ID")
107110
startRepair.PersistentFlags().String("rootpath", "", "File path for local files ")
108111
startRepair.PersistentFlags().String("repairpath", "", "Path to repair")
112+
startRepair.PersistentFlags().IntP("repairbatchsize", "rbs", 50, "Repair batch size")
109113
startRepair.MarkFlagRequired("allocation")
110114
startRepair.MarkFlagRequired("rootpath")
111115
startRepair.MarkFlagRequired("repairpath")

0 commit comments

Comments
 (0)