Close calls teardown for any cached buckets and removes from cachedBucketConnections
()
| 477 | |
| 478 | // Close calls teardown for any cached buckets and removes from cachedBucketConnections |
| 479 | func (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 | |
| 492 | func (cc *CouchbaseCluster) getBucket(ctx context.Context, bucketName string) (b *gocb.Bucket, teardownFn func(), err error) { |
| 493 |