MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / removeOutdatedBuckets

Method removeOutdatedBuckets

base/bootstrap.go:98–109  ·  view source on GitHub ↗

removeOutdatedBuckets marks any active buckets for closure and removes the cached connections.

(activeBuckets Set)

Source from the content-addressed store, hash-verified

96
97// removeOutdatedBuckets marks any active buckets for closure and removes the cached connections.
98func (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
112func (c *cachedBucketConnections) closeAll() {

Callers 2

TestBootstrapRefCountingFunction · 0.80
GetConfigBucketsMethod · 0.80

Calls 3

_teardownMethod · 0.95
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1

TestBootstrapRefCountingFunction · 0.64