removeOutdatedBuckets marks any active buckets for closure and removes the cached connections.
(activeBuckets Set)
| 96 | |
| 97 | // removeOutdatedBuckets marks any active buckets for closure and removes the cached connections. |
| 98 | func (c *cachedBucketConnections) removeOutdatedBuckets(activeBuckets Set) { |
| 99 | c.lock.Lock() |
| 100 | defer c.lock.Unlock() |
| 101 | for bucketName, bucket := range c.buckets { |
| 102 | _, exists := activeBuckets[bucketName] |
| 103 | if exists { |
| 104 | continue |
| 105 | } |
| 106 | bucket.shouldClose = true |
| 107 | c._teardown(bucketName) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | // closeAll removes all cached bucekts |
| 112 | func (c *cachedBucketConnections) closeAll() { |