CleanAgedItems prunes the caches based on age of items. Error returned to fulfill BackgroundTaskFunc signature.
(ctx context.Context)
| 301 | |
| 302 | // CleanAgedItems prunes the caches based on age of items. Error returned to fulfill BackgroundTaskFunc signature. |
| 303 | func (c *channelCacheImpl) cleanAgedItems(ctx context.Context) error { |
| 304 | |
| 305 | callback := func(v interface{}) bool { |
| 306 | channelCache := AsSingleChannelCache(ctx, v) |
| 307 | if channelCache == nil { |
| 308 | return false |
| 309 | } |
| 310 | channelCache.pruneCacheAge(ctx) |
| 311 | return true |
| 312 | } |
| 313 | c.channelCaches.Range(callback) |
| 314 | |
| 315 | return nil |
| 316 | } |
| 317 | |
| 318 | func (c *channelCacheImpl) getChannelCache(ctx context.Context, channel channels.ID) (SingleChannelCache, error) { |
| 319 |
nothing calls this directly
no test coverage detected