File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,12 @@ import (
4
4
"context"
5
5
"fmt"
6
6
"slices"
7
- "strings"
8
7
"time"
9
8
10
9
"cloud.google.com/go/bigtable"
11
10
"golang.org/x/exp/maps"
11
+ "google.golang.org/grpc/codes"
12
+ "google.golang.org/grpc/status"
12
13
)
13
14
14
15
var ErrNotFound = fmt .Errorf ("not found" )
@@ -324,14 +325,13 @@ func (b BigTableStore) Clear() error {
324
325
// Close shuts down the BigTableStore by closing the Bigtable client connection
325
326
// It returns an error if the operation fails
326
327
func (b BigTableStore ) Close () error {
327
- if err := b .client .Close (); err != nil {
328
+ if err := b .client .Close (); err != nil && status . Code ( err ) != codes . Canceled {
328
329
return fmt .Errorf ("could not close client: %v" , err )
329
330
}
330
- if err := b .admin . Close (); err != nil {
331
- if ! strings . Contains ( err . Error (), "the client connection is closing" ) {
331
+ if b .admin != nil {
332
+ if err := b . admin . Close (); err != nil && status . Code ( err ) != codes . Canceled {
332
333
return fmt .Errorf ("could not close admin client: %v" , err )
333
334
}
334
335
}
335
-
336
336
return nil
337
337
}
You can’t perform that action at this time.
0 commit comments