Remove purges the given doc IDs from all channel caches and returns the number of items removed. count will be larger than the input slice if the same document is removed from multiple channel caches.
(ctx context.Context, collectionID uint32, docIDs []string, startTime time.Time)
| 258 | // Remove purges the given doc IDs from all channel caches and returns the number of items removed. |
| 259 | // count will be larger than the input slice if the same document is removed from multiple channel caches. |
| 260 | func (c *channelCacheImpl) Remove(ctx context.Context, collectionID uint32, docIDs []string, startTime time.Time) (count int) { |
| 261 | // Exit early if there's no work to do |
| 262 | if len(docIDs) == 0 { |
| 263 | return 0 |
| 264 | } |
| 265 | |
| 266 | removeCallback := func(v interface{}) bool { |
| 267 | channelCache := AsSingleChannelCache(ctx, v) |
| 268 | if channelCache == nil { |
| 269 | return false |
| 270 | } |
| 271 | if channelCache.ChannelID().CollectionID != collectionID { |
| 272 | return true |
| 273 | } |
| 274 | count += channelCache.Remove(ctx, collectionID, docIDs, startTime) |
| 275 | return true |
| 276 | } |
| 277 | |
| 278 | c.channelCaches.Range(removeCallback) |
| 279 | |
| 280 | return count |
| 281 | } |
| 282 | |
| 283 | func (c *channelCacheImpl) GetChanges(ctx context.Context, ch channels.ID, options ChangesOptions) ([]*LogEntry, error) { |
| 284 |
nothing calls this directly
no test coverage detected