small fix
This commit is contained in:
@ -104,9 +104,13 @@ type quotaPool struct {
|
|||||||
|
|
||||||
// newQuotaPool creates a quotaPool which has quota q available to consume.
|
// newQuotaPool creates a quotaPool which has quota q available to consume.
|
||||||
func newQuotaPool(q int) *quotaPool {
|
func newQuotaPool(q int) *quotaPool {
|
||||||
qb := "aPool{c: make(chan int, 1)}
|
qb := "aPool{
|
||||||
|
c: make(chan int, 1),
|
||||||
|
}
|
||||||
if q > 0 {
|
if q > 0 {
|
||||||
qb.c <- q
|
qb.c <- q
|
||||||
|
} else {
|
||||||
|
qb.quota = q
|
||||||
}
|
}
|
||||||
return qb
|
return qb
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user