This commit is contained in:
jiangyong 2026-05-08 18:52:53 +08:00
parent 49b7b09516
commit ef40809f81
1 changed files with 4 additions and 4 deletions

View File

@ -70,13 +70,13 @@ func (w *WindowsLimit) Allow() bool {
succCmd := w.client.ZCount(w.option.succKey, fmt.Sprintf("%d", start), fmt.Sprintf("%d", now))
_, err := pipe.Exec()
if err != nil {
return false
return true
}
if succCmd.Val() >= w.option.Count {
return false
}
if succCmd.Val() <= w.option.Count {
return true
}
return false
}
func (w *WindowsLimit) Add(succ bool) error {