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)) 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 {