(d time.Duration)
| 332 | } |
| 333 | |
| 334 | func (m *Matcher) clean(d time.Duration) { |
| 335 | t := time.NewTimer(d / 2) |
| 336 | for { |
| 337 | select { |
| 338 | case <-m.stop: |
| 339 | return |
| 340 | case <-t.C: |
| 341 | m.mut.Lock() |
| 342 | if m.matches != nil { |
| 343 | m.matches.clean(d) |
| 344 | } |
| 345 | t.Reset(d / 2) |
| 346 | m.mut.Unlock() |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | func hashPatterns(patterns []Pattern) string { |
| 352 | h := sha256.New() |