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

Method Close

base/bootstrap.go:479–490  ·  view source on GitHub ↗

Close calls teardown for any cached buckets and removes from cachedBucketConnections

()

Source from the content-addressed store, hash-verified

477
478// Close calls teardown for any cached buckets and removes from cachedBucketConnections
479func (cc *CouchbaseCluster) Close() {
480
481 cc.cachedBucketConnections.closeAll()
482
483 cc.cachedConnectionLock.Lock()
484 defer cc.cachedConnectionLock.Unlock()
485
486 if cc.cachedClusterConnection != nil {
487 _ = cc.cachedClusterConnection.Close(nil)
488 cc.cachedClusterConnection = nil
489 }
490}
491
492func (cc *CouchbaseCluster) getBucket(ctx context.Context, bucketName string) (b *gocb.Bucket, teardownFn func(), err error) {
493

Callers 1

TestBootstrapRefCountingFunction · 0.95

Calls 4

closeAllMethod · 0.80
CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1

TestBootstrapRefCountingFunction · 0.76