File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ package store
2
2
3
3
import (
4
4
"context"
5
+ "errors"
5
6
"fmt"
6
7
"slices"
7
- "strings"
8
8
"time"
9
9
10
10
"cloud.google.com/go/bigtable"
11
11
"golang.org/x/exp/maps"
12
+ "google.golang.org/grpc"
12
13
)
13
14
14
15
var ErrNotFound = fmt .Errorf ("not found" )
@@ -324,14 +325,11 @@ 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 && ! errors . Is ( err , grpc . ErrClientConnClosing ) {
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" ) {
332
- return fmt .Errorf ("could not close admin client: %v" , err )
333
- }
331
+ if err := b .admin .Close (); err != nil && ! errors .Is (err , grpc .ErrClientConnClosing ) {
332
+ return fmt .Errorf ("could not close admin client: %v" , err )
334
333
}
335
-
336
334
return nil
337
335
}
You can’t perform that action at this time.
0 commit comments