Skip to content

Commit

Permalink
feat:update example docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Nov 19, 2023
1 parent a8f9414 commit 46dc539
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions plugin/ratelimiter/common/ratelimit_slice_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ func (s *SlidingWindow) currentWindow(curTimeMs int64, reset bool) (*Window, *Wi
return oldWindow, nil
} else if !reset {
return nil, nil
} else {
s.mutex.Lock()
expiredWindow := oldWindow.reset(oldWindowStart, windowStart)
s.mutex.Unlock()
return oldWindow, expiredWindow
}
s.mutex.Lock()
expiredWindow := oldWindow.reset(oldWindowStart, windowStart)
s.mutex.Unlock()
return oldWindow, expiredWindow
}

// AddAndGetCurrentPassed 原子增加,并返回当前bucket
Expand Down

0 comments on commit 46dc539

Please sign in to comment.