Browse Source

adjust API

pull/1513/head
Chris Lu 4 years ago
parent
commit
8f8e9ddbde
  1. 4
      weed/filer/reader_at.go

4
weed/filer/reader_at.go

@ -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,9 +160,11 @@ func (c *ChunkReadAt) readFromWholeChunkData(chunkView, nextChunkView *ChunkView
c.lastChunkFileId = chunkView.FileId c.lastChunkFileId = chunkView.FileId
go func() { go func() {
for _, nextChunkView := range nextChunkViews {
if c.chunkCache != nil && nextChunkView != nil { if c.chunkCache != nil && nextChunkView != nil {
c.readOneWholeChunk(nextChunkView) c.readOneWholeChunk(nextChunkView)
} }
}
}() }()
return return

Loading…
Cancel
Save