This splits the ignore getting to two methods, one that loads from disk (the old one) and one that just returns whatever is already loaded (the new one). The folder summary service which is just interested in stats now uses the latter method. This means that it, and API calls that call it, does not get blocked by folder I/O.
This commit is contained in:
@@ -1405,7 +1405,7 @@ func changeIgnores(t *testing.T, m *testModel, expected []string) {
|
||||
return true
|
||||
}
|
||||
|
||||
ignores, _, err := m.GetIgnores("default")
|
||||
ignores, _, err := m.LoadIgnores("default")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -1421,7 +1421,7 @@ func changeIgnores(t *testing.T, m *testModel, expected []string) {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
ignores2, _, err := m.GetIgnores("default")
|
||||
ignores2, _, err := m.LoadIgnores("default")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -1441,7 +1441,7 @@ func changeIgnores(t *testing.T, m *testModel, expected []string) {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
ignores, _, err = m.GetIgnores("default")
|
||||
ignores, _, err = m.LoadIgnores("default")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -1472,7 +1472,7 @@ func TestIgnores(t *testing.T) {
|
||||
|
||||
changeIgnores(t, m, expected)
|
||||
|
||||
_, _, err := m.GetIgnores("doesnotexist")
|
||||
_, _, err := m.LoadIgnores("doesnotexist")
|
||||
if err == nil {
|
||||
t.Error("No error")
|
||||
}
|
||||
@@ -1490,7 +1490,7 @@ func TestIgnores(t *testing.T) {
|
||||
m.folderIgnores[fcfg.ID] = ignores
|
||||
m.fmut.Unlock()
|
||||
|
||||
_, _, err = m.GetIgnores("fresh")
|
||||
_, _, err = m.LoadIgnores("fresh")
|
||||
if err == nil {
|
||||
t.Error("No error")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user