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 <jakob@kastelo.net>
This commit is contained in:
André Colomb 2022-08-10 08:50:19 +02:00 committed by GitHub
parent 28c660e41d
commit 4d4bfe8032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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)