adjust API
This commit is contained in:
@@ -142,7 +142,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ChunkReadAt) readFromWholeChunkData(chunkView, nextChunkView *ChunkView) (chunkData []byte, err error) {
|
func (c *ChunkReadAt) readFromWholeChunkData(chunkView *ChunkView, nextChunkViews... *ChunkView) (chunkData []byte, err error) {
|
||||||
|
|
||||||
if c.lastChunkFileId == chunkView.FileId {
|
if c.lastChunkFileId == chunkView.FileId {
|
||||||
return c.lastChunkData, nil
|
return c.lastChunkData, nil
|
||||||
@@ -160,8 +160,10 @@ func (c *ChunkReadAt) readFromWholeChunkData(chunkView, nextChunkView *ChunkView
|
|||||||
c.lastChunkFileId = chunkView.FileId
|
c.lastChunkFileId = chunkView.FileId
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
if c.chunkCache != nil && nextChunkView != nil {
|
for _, nextChunkView := range nextChunkViews {
|
||||||
c.readOneWholeChunk(nextChunkView)
|
if c.chunkCache != nil && nextChunkView != nil {
|
||||||
|
c.readOneWholeChunk(nextChunkView)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user