Compare commits
No commits in common. "0caa54f0282993aa77c446bdd7e6e389779cdeea" and "35b64515d767f38913247d58c69893adfc87348e" have entirely different histories.
0caa54f028
...
35b64515d7
|
@ -223,16 +223,13 @@ func (i *ImportReader) Close() error {
|
||||||
func (i *ImportReader) Read(p []byte) (n int, err error) {
|
func (i *ImportReader) Read(p []byte) (n int, err error) {
|
||||||
n, err = i.reader.Read(p)
|
n, err = i.reader.Read(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
|
||||||
return n, err
|
|
||||||
}
|
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update cumulative bytes read
|
// Update cumulative bytes read
|
||||||
i.bytesRead += uint64(n)
|
i.bytesRead += uint64(n)
|
||||||
|
|
||||||
err = i.ReadBytes(0)
|
err = i.ReadBytes(n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
@ -241,9 +238,6 @@ func (i *ImportReader) Read(p []byte) (n int, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *ImportReader) ReadBytes(n int) (err error) {
|
func (i *ImportReader) ReadBytes(n int) (err error) {
|
||||||
if n > 0 {
|
|
||||||
i.bytesRead += uint64(n)
|
|
||||||
}
|
|
||||||
stageProgress := float64(100) / float64(i.totalStages)
|
stageProgress := float64(100) / float64(i.totalStages)
|
||||||
|
|
||||||
// Calculate progress based on bytes read
|
// Calculate progress based on bytes read
|
||||||
|
|
Loading…
Reference in New Issue