Skip to content

Commit f158334

Browse files
Merge pull request #61 from everFinance/feature/fix-conc-download
Feature/fix conc download
2 parents 202cca3 + c78230f commit f158334

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

client.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ func (c *Client) ConcurrentDownloadChunkDataStream(id string, concurrentNum int)
814814
var data []byte
815815
data, err = c.DownloadChunkData(id)
816816
if err != nil {
817-
return nil, err
817+
return
818818
}
819819
_, err = dataFile.Write(data)
820820
return dataFile, err
@@ -868,13 +868,13 @@ func (c *Client) ConcurrentDownloadChunkDataStream(id string, concurrentNum int)
868868
wg.Add(1)
869869
if err = p.Invoke(Offset{fileOffset: offset, chunkOffset: offset + startOffset}); err != nil {
870870
log.Error("p.Invoke(i)", "err", err, "i", i)
871-
return nil, err
871+
return
872872
}
873873
}
874874
wg.Wait()
875875
_, err = dataFile.Seek(0, 2)
876876
if err != nil {
877-
return nil, err
877+
return
878878
}
879879
// add latest 2 chunks
880880
start := offsetArr[len(offsetArr)-3] + startOffset + types.MAX_CHUNK_SIZE
@@ -897,13 +897,13 @@ func (c *Client) ConcurrentDownloadChunkDataStream(id string, concurrentNum int)
897897
}
898898
if err != nil {
899899
err = errors.New(fmt.Sprintf("concurrent get latest two chunks failed,err:%v", err))
900-
return nil, err
900+
return
901901
}
902902
n := 0
903903
n, err = dataFile.Write(chunkData)
904904
if err != nil || n < len(chunkData) {
905905
err = fmt.Errorf("write dataFile error writeSize:%d, expectSize:%d", n, len(chunkData))
906-
return nil, err
906+
return
907907
}
908908
i += len(chunkData)
909909
}

0 commit comments

Comments
 (0)