mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix parameters
This commit is contained in:
parent
0452ae6a6c
commit
ea271600ec
|
@ -24,16 +24,15 @@ func (fs *FilerSink) replicateChunks(sourceChunks []*filer_pb.FileChunk, path st
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
for chunkIndex, sourceChunk := range sourceChunks {
|
for chunkIndex, sourceChunk := range sourceChunks {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
index, source := chunkIndex, sourceChunk
|
||||||
fs.executor.Execute(func() {
|
fs.executor.Execute(func() {
|
||||||
func(chunk *filer_pb.FileChunk, index int) {
|
defer wg.Done()
|
||||||
defer wg.Done()
|
replicatedChunk, e := fs.replicateOneChunk(source, path)
|
||||||
replicatedChunk, e := fs.replicateOneChunk(chunk, path)
|
if e != nil {
|
||||||
if e != nil {
|
err = e
|
||||||
err = e
|
return
|
||||||
return
|
}
|
||||||
}
|
replicatedChunks[index] = replicatedChunk
|
||||||
replicatedChunks[index] = replicatedChunk
|
|
||||||
}(sourceChunk, chunkIndex)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
Loading…
Reference in a new issue