More consistent use of signal struct
This commit is contained in:
parent
cb09125dc4
commit
eaca1ee1f7
9 changed files with 68 additions and 68 deletions
|
|
@ -66,11 +66,11 @@ func (rate *Ratelimiter) GarbageCollectEntries() {
|
|||
rate.mutex.Unlock()
|
||||
}
|
||||
|
||||
func (rate *Ratelimiter) RoutineGarbageCollector(stop chan struct{}) {
|
||||
func (rate *Ratelimiter) RoutineGarbageCollector(stop Signal) {
|
||||
timer := time.NewTimer(time.Second)
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
case <-stop.Wait():
|
||||
return
|
||||
case <-timer.C:
|
||||
rate.GarbageCollectEntries()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue