Skip to content

Commit ef52cc1

Browse files
committed
chore(options): check workerCount constraints.
1 parent eac4c82 commit ef52cc1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

options.go

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ func (f OptionFunc) apply(option *Options) {
3333
// WithWorkerCount set worker count
3434
func WithWorkerCount(num int) Option {
3535
return OptionFunc(func(q *Options) {
36+
if num <= 0 {
37+
num = defaultWorkerCount
38+
}
3639
q.workerCount = num
3740
})
3841
}

0 commit comments

Comments
 (0)