false
This commit is contained in:
parent
49b7b09516
commit
ef40809f81
8
limit.go
8
limit.go
|
|
@ -70,14 +70,14 @@ func (w *WindowsLimit) Allow() bool {
|
||||||
succCmd := w.client.ZCount(w.option.succKey, fmt.Sprintf("%d", start), fmt.Sprintf("%d", now))
|
succCmd := w.client.ZCount(w.option.succKey, fmt.Sprintf("%d", start), fmt.Sprintf("%d", now))
|
||||||
_, err := pipe.Exec()
|
_, err := pipe.Exec()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if succCmd.Val() >= w.option.Count {
|
if succCmd.Val() <= w.option.Count {
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (w *WindowsLimit) Add(succ bool) error {
|
func (w *WindowsLimit) Add(succ bool) error {
|
||||||
now := time.Now().UnixMilli()
|
now := time.Now().UnixMilli()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue