File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 11package snapshotstream
22
33import (
4- "bufio"
54 "compress/gzip"
65 "crypto/sha256"
76 "encoding/hex"
@@ -93,21 +92,15 @@ func (s *Stream) Status() api.DownloadStatus {
9392}
9493
9594func (s * Stream ) writeTo (w io.Writer ) (err error ) {
96- bufWriter := bufio .NewWriterSize (w , 1024 * 1024 )
97-
98- defer func () {
99- multierr .AppendInto (& err , bufWriter .Flush ())
100- }()
101-
10295 var archiveWriter io.Writer
10396 var compressionFlush func () error
10497
10598 switch s .format {
10699 case api .ArchiveTar :
107- archiveWriter = bufWriter
100+ archiveWriter = w
108101
109102 case api .ArchiveTarGzip :
110- gzipWriter := gzip .NewWriter (bufWriter )
103+ gzipWriter := gzip .NewWriter (w )
111104 gzipWriter .Header .Name = strings .TrimSuffix (filepath .Base (s .Filename ), filepath .Ext (s .Filename ))
112105 gzipWriter .Header .Comment = fmt .Sprintf ("Prometheus snapshot %s" , s .name )
113106
You can’t perform that action at this time.
0 commit comments