Skip to content

Commit d68fd24

Browse files
author
eric
committed
add boundary judgment to parallel parameter
1 parent d7b7dd0 commit d68fd24

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.PHONY: build
22
build:
3-
go build -ldflags "-s -w" -o graphsplit graphsplit.go utils.go retrieve.go
3+
go build -ldflags "-s -w" -o graphsplit graphsplit.go utils.go retrieve.go

graphsplit.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ var chunkCmd = &cli.Command{
7474
if sliceSize == 0 {
7575
return xerrors.Errorf("Unexpected! Slice size has been set as 0")
7676
}
77+
if parallel <= 0 {
78+
return xerrors.Errorf("Unexpected! Parallel has to be greater than 0")
79+
}
7780

7881
args := c.Args().Slice()
7982
sliceTotal := GetGraphCount(args, sliceSize)
@@ -191,6 +194,9 @@ var retrieveCmd = &cli.Command{
191194
parallel := c.Int("parallel")
192195
outputDir := c.String("output-dir")
193196
carPath := c.String("car-path")
197+
if parallel <= 0 {
198+
return xerrors.Errorf("Unexpected! Parallel has to be greater than 0")
199+
}
194200

195201
CarTo(carPath, outputDir, parallel)
196202
Merge(outputDir, parallel)

0 commit comments

Comments
 (0)