File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ var Conf = struct {
3131}{
3232 PathRule : "/rule.ls" ,
3333 PathCIDR : "/rule.cidr" ,
34- Version : "v1.24.1 " ,
34+ Version : "v1.24.2 " ,
3535}
3636
3737const helpMsg = `Usage: daze <command> [<args>]
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ type Limits struct {
2222// Wait ensures there are enough resources (n) available, blocking if necessary.
2323func (l * Limits ) Wait (n uint64 ) {
2424 doa .Doa (n < math .MaxUint64 / 2 )
25+ doa .Doa (l .size <= l .capacity )
2526 l .mu .Lock ()
2627 defer l .mu .Unlock ()
2728 l .loop = uint64 (time .Since (l .last ) / l .step )
@@ -55,14 +56,14 @@ func NewLimits(r uint64, p time.Duration) *Limits {
5556 }
5657 return a
5758 }(r , uint64 (p ))
58- r = r / g
59- p = p / time .Duration (g )
59+ a : = r / g
60+ s : = p / time .Duration (g )
6061 return & Limits {
61- addition : r ,
62- capacity : r * 2 ,
62+ addition : a ,
63+ capacity : r ,
6364 last : time .Now (),
6465 mu : sync.Mutex {},
6566 size : r ,
66- step : p ,
67+ step : s ,
6768 }
6869}
You can’t perform that action at this time.
0 commit comments