Skip to content

Commit

Permalink
fix(session): close client after session creation
Browse files Browse the repository at this point in the history
  • Loading branch information
karol-kokoszka committed Mar 29, 2024
1 parent 4a19989 commit 748e329
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/service/cluster/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,11 @@ func (s *Service) GetSession(ctx context.Context, clusterID uuid.UUID) (session
if err != nil {
return session, errors.Wrap(err, "get client")
}
defer func() {
if err := client.Close(); err != nil {
s.logger.Error(ctx, "Couldn't close scylla client", "error", err)
}
}()

ni, err := client.AnyNodeInfo(ctx)
if err != nil {
Expand Down

0 comments on commit 748e329

Please sign in to comment.