More consistent use of signal struct

This commit is contained in:
Mathias Hall-Andersen 2017-12-01 23:37:26 +01:00
parent cb09125dc4
commit eaca1ee1f7
9 changed files with 68 additions and 68 deletions

View file

@ -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()