mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
lib/model: Actually break puller loop on context cancel (#7492)
Current break does nothing (breaks the select).
This commit is contained in:
parent
6d93d9c488
commit
81484699db
@ -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:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user