()
| 224 | } |
| 225 | |
| 226 | func (ca *RuntimeCache) gc() { |
| 227 | for { |
| 228 | <-time.After(ca.gcInterval) |
| 229 | if ca.items == nil { |
| 230 | return |
| 231 | } |
| 232 | ca.items.Range(func(key interface{}, v interface{}) bool { |
| 233 | ca.itemExpired(fmt.Sprint(key)) |
| 234 | return true |
| 235 | }) |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | // itemExpired returns true if an item is expired. |
| 240 | func (ca *RuntimeCache) itemExpired(name string) bool { |
no test coverage detected