satellite/metainfo: Close client DeleteObjectPieces

The DeleteObjectPieces should print out the warning on closing the
connections only if there was an error.

Change-Id: If3d7ab256d8508c08388c1f22c7dd1eb819d2509
This commit is contained in:
littleskunk 2020-01-08 15:54:11 +01:00
parent 922c43f921
commit 05e4a86654
No known key found for this signature in database
GPG Key ID: E5C6B2C94E5BB7F9

View File

@ -2401,11 +2401,13 @@ func (endpoint *Endpoint) DeleteObjectPieces(
}
defer func() {
err := client.Close()
endpoint.log.Warn("error closing the storage node client connection",
zap.Stringer("node_id", node.Id),
zap.Stringer("node_info", node),
zap.Error(err),
)
if err != nil {
endpoint.log.Warn("error closing the storage node client connection",
zap.Stringer("node_id", node.Id),
zap.Stringer("node_info", node),
zap.Error(err),
)
}
}()
for _, pieceID := range nodePieces {