lib/model: Actually break puller loop on context cancel (#7492)

Current break does nothing (breaks the select).
This commit is contained in:
Jakob Borg 2021-03-17 21:34:52 +01:00 committed by GitHub
parent 6d93d9c488
commit 81484699db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1496,11 +1496,12 @@ func (f *sendReceiveFolder) pullBlock(state pullBlockState, snap *db.Snapshot, o
var lastError error var lastError error
candidates := f.model.availabilityInSnapshot(f.FolderConfiguration, snap, state.file, state.block) candidates := f.model.availabilityInSnapshot(f.FolderConfiguration, snap, state.file, state.block)
loop:
for { for {
select { select {
case <-f.ctx.Done(): case <-f.ctx.Done():
state.fail(errors.Wrap(f.ctx.Err(), "folder stopped")) state.fail(errors.Wrap(f.ctx.Err(), "folder stopped"))
break break loop
default: default:
} }