From 81484699db4eaf4eaefe5d5d1c79740aa698a70b Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 17 Mar 2021 21:34:52 +0100 Subject: [PATCH] lib/model: Actually break puller loop on context cancel (#7492) Current break does nothing (breaks the select). --- lib/model/folder_sendrecv.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/model/folder_sendrecv.go b/lib/model/folder_sendrecv.go index 27783ddb4..34b1411d3 100644 --- a/lib/model/folder_sendrecv.go +++ b/lib/model/folder_sendrecv.go @@ -1496,11 +1496,12 @@ func (f *sendReceiveFolder) pullBlock(state pullBlockState, snap *db.Snapshot, o var lastError error candidates := f.model.availabilityInSnapshot(f.FolderConfiguration, snap, state.file, state.block) +loop: for { select { case <-f.ctx.Done(): state.fail(errors.Wrap(f.ctx.Err(), "folder stopped")) - break + break loop default: }