fix: improve download speeds for restored files

This commit is contained in:
garethgeorge
2024-05-12 01:23:20 -07:00
parent 411a4fb6f0
commit eb079317c0
+2 -2
View File
@@ -55,8 +55,8 @@ func NewDownloadHandler(oplog *oplog.OpLog) http.Handler {
w.Header().Set("Content-Type", "application/gzip")
w.Header().Set("Content-Transfer-Encoding", "binary")
gzw := gzip.NewWriter(w)
if err := tarDirectory(w, fullPath); err != nil {
gzw, _ := gzip.NewWriterLevel(w, gzip.BestSpeed)
if err := tarDirectory(gzw, fullPath); err != nil {
zap.S().Errorf("error creating tar archive: %v", err)
http.Error(w, "error creating tar archive", http.StatusInternalServerError)
return