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:
+1
-1
@@ -1218,7 +1218,7 @@ func (s *service) getDBIgnores(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
folder := qs.Get("folder")
|
||||
|
||||
lines, patterns, err := s.model.GetIgnores(folder)
|
||||
lines, patterns, err := s.model.LoadIgnores(folder)
|
||||
if err != nil && !ignore.IsParseError(err) {
|
||||
http.Error(w, err.Error(), 500)
|
||||
return
|
||||
|
||||
@@ -80,7 +80,11 @@ func (m *mockedModel) Availability(folder string, file protocol.FileInfo, block
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *mockedModel) GetIgnores(folder string) ([]string, []string, error) {
|
||||
func (m *mockedModel) LoadIgnores(folder string) ([]string, []string, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
func (m *mockedModel) CurrentIgnores(folder string) ([]string, []string, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user