lib/model: Don't include unshared folders in ClusterConfig (fixes #4926)
Also fixes a data race where ClusterConfig would access folderFiles without a lock. Tweaked the ClusterConfig unit test to verify the behavior.
This commit is contained in:
committed by
Audrius Butkevicius
parent
616883304e
commit
2343c82c33
@@ -607,20 +607,29 @@ func TestClusterConfig(t *testing.T) {
|
||||
cfg.Folders = []config.FolderConfiguration{
|
||||
{
|
||||
ID: "folder1",
|
||||
Path: "testdata",
|
||||
Path: "testdata1",
|
||||
Devices: []config.FolderDeviceConfiguration{
|
||||
{DeviceID: device1},
|
||||
{DeviceID: device2},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "folder2",
|
||||
Path: "testdata",
|
||||
ID: "folder2",
|
||||
Path: "testdata2",
|
||||
Paused: true, // should still be included
|
||||
Devices: []config.FolderDeviceConfiguration{
|
||||
{DeviceID: device1},
|
||||
{DeviceID: device2},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "folder3",
|
||||
Path: "testdata3",
|
||||
Devices: []config.FolderDeviceConfiguration{
|
||||
{DeviceID: device1},
|
||||
// should not be included, does not include device2
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
db := db.OpenMemory()
|
||||
|
||||
Reference in New Issue
Block a user