fix(model): loop-break regression while block copying in puller (#10069)

This commit is contained in:
Simon Frei
2025-04-24 08:29:30 +07:00
committed by GitHub
parent 50480b89fc
commit be002362b3
+3 -2
View File
@@ -1346,6 +1346,7 @@ func (f *sendReceiveFolder) copierRoutine(in <-chan copyBlocksState, pullChan ch
found := false found := false
blocks, _ := f.model.sdb.AllLocalBlocksWithHash(block.Hash) blocks, _ := f.model.sdb.AllLocalBlocksWithHash(block.Hash)
innerBlocks:
for _, e := range blocks { for _, e := range blocks {
res, err := f.model.sdb.AllLocalFilesWithBlocksHashAnyFolder(e.BlocklistHash) res, err := f.model.sdb.AllLocalFilesWithBlocksHashAnyFolder(e.BlocklistHash)
if err != nil { if err != nil {
@@ -1387,7 +1388,7 @@ func (f *sendReceiveFolder) copierRoutine(in <-chan copyBlocksState, pullChan ch
} }
if err != nil { if err != nil {
state.fail(fmt.Errorf("dst write: %w", err)) state.fail(fmt.Errorf("dst write: %w", err))
break break innerBlocks
} }
if fi.Name == state.file.Name { if fi.Name == state.file.Name {
state.copiedFromOrigin(block.Size) state.copiedFromOrigin(block.Size)
@@ -1395,7 +1396,7 @@ func (f *sendReceiveFolder) copierRoutine(in <-chan copyBlocksState, pullChan ch
state.copiedFromElsewhere(block.Size) state.copiedFromElsewhere(block.Size)
} }
found = true found = true
break break innerBlocks
} }
} }
} }