Compare commits
3 Commits
35b64515d7
...
0caa54f028
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 0caa54f028 | |
Derrick Hammer | 96713e3538 | |
Derrick Hammer | ba60a6c729 |
|
@ -223,13 +223,16 @@ 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(n)
|
err = i.ReadBytes(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
@ -238,6 +241,9 @@ 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