Explorar o código

lib/model: Skip paused folders in aggregated completion loop (fixes #8219) (#8220)

Locally paused folders will fail on checkFolderRunningLocked() and
therefore abort the loop.  Avoid this by skipping paused folders
directly.

Co-authored-by: Jakob Borg <[email protected]>
André Colomb %!s(int64=3) %!d(string=hai) anos
pai
achega
4d4bfe8032
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      lib/model/model.go

+ 6 - 1
lib/model/model.go

@@ -877,9 +877,14 @@ func (m *model) Completion(device protocol.DeviceID, folder string) (FolderCompl
 	// We want completion for all (shared) folders as an aggregate.
 	var comp FolderCompletion
 	for _, fcfg := range m.cfg.FolderList() {
+		if fcfg.Paused {
+			continue
+		}
 		if device == protocol.LocalDeviceID || fcfg.SharedWith(device) {
 			folderComp, err := m.folderCompletion(device, fcfg.ID)
-			if err != nil {
+			if errors.Is(err, ErrFolderPaused) {
+				continue
+			} else if err != nil {
 				return FolderCompletion{}, err
 			}
 			comp.add(folderComp)