Browse Source

fix parameters

pull/3789/head
chrislu 2 years ago
parent
commit
ea271600ec
  1. 17
      weed/replication/sink/filersink/fetch_write.go

17
weed/replication/sink/filersink/fetch_write.go

@ -24,16 +24,15 @@ func (fs *FilerSink) replicateChunks(sourceChunks []*filer_pb.FileChunk, path st
var wg sync.WaitGroup
for chunkIndex, sourceChunk := range sourceChunks {
wg.Add(1)
index, source := chunkIndex, sourceChunk
fs.executor.Execute(func() {
func(chunk *filer_pb.FileChunk, index int) {
defer wg.Done()
replicatedChunk, e := fs.replicateOneChunk(chunk, path)
if e != nil {
err = e
return
}
replicatedChunks[index] = replicatedChunk
}(sourceChunk, chunkIndex)
defer wg.Done()
replicatedChunk, e := fs.replicateOneChunk(source, path)
if e != nil {
err = e
return
}
replicatedChunks[index] = replicatedChunk
})
}
wg.Wait()

Loading…
Cancel
Save