Skip to content

Commit 8dd6e5e

Browse files
committed
improve progress
1 parent e727c06 commit 8dd6e5e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cmd/src/snapshot_upload.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,12 @@ func copyToBucket(ctx context.Context, src io.Reader, stat fs.FileInfo, dst *sto
148148
return err
149149
}
150150

151+
// Progress is not called on completion, so we call it manually after io.Copy is done
152+
progressFn(written)
153+
151154
// Validate we have sent all data
152-
if size := stat.Size(); written != size {
155+
size := stat.Size()
156+
if written != size {
153157
return errors.Newf("expected to write %d bytes, but actually wrote %d bytes",
154158
size, written)
155159
}

0 commit comments

Comments
 (0)