Add proper context based logging when bitrot stream calls fail (#7415)

This commit is contained in:
Harshavardhana
2019-03-26 13:59:33 -07:00
committed by kannappanr
parent 0250f7de67
commit 9629de8230
2 changed files with 9 additions and 5 deletions

View File

@@ -133,7 +133,7 @@ func newBitrotReader(disk StorageAPI, bucket string, filePath string, tillOffset
// Close all the readers.
func closeBitrotReaders(rs []io.ReaderAt) {
for _, r := range rs {
if br, ok := r.(*streamingBitrotReader); ok {
if br, ok := r.(io.Closer); ok {
br.Close()
}
}
@@ -142,7 +142,7 @@ func closeBitrotReaders(rs []io.ReaderAt) {
// Close all the writers.
func closeBitrotWriters(ws []io.Writer) {
for _, w := range ws {
if bw, ok := w.(*streamingBitrotWriter); ok {
if bw, ok := w.(io.Closer); ok {
bw.Close()
}
}