fix parameters

This commit is contained in:
chrislu 2022-10-04 12:36:05 -07:00
parent 0452ae6a6c
commit ea271600ec

View file

@ -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)
replicatedChunk, e := fs.replicateOneChunk(source, path)
if e != nil {
err = e
return
}
replicatedChunks[index] = replicatedChunk
}(sourceChunk, chunkIndex)
})
}
wg.Wait()