Skip to content
Snippets Groups Projects
Verified Commit 634d87d1 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

refactor assign file list

parent 4fec0239
No related branches found
No related tags found
No related merge requests found
......@@ -93,10 +93,21 @@ func (s *Settings[C]) importStreams() {
func (s *Settings[C]) importFiles() {
s.fileWatch.Lock()
defer s.fileWatch.Unlock()
// new files may have been added
s.fileWatch.watchList = make(map[string]string)
tmpWatchList := make(map[string]string)
defer func() {
s.fileWatch.watchList = tmpWatchList
s.fileWatch.Unlock()
}()
errorCount := len(s.errors)
defer func() {
if len(s.errors) > errorCount {
s.notifyErrorHooks()
}
}()
for _, d := range s.files.directories {
fn := path.Join(d, s.files.name+s.files.format.Extension())
......@@ -112,7 +123,7 @@ func (s *Settings[C]) importFiles() {
s.importStream(reader{s.files.format, r})
f.Close()
s.fileWatch.watchList[fn] = fn
tmpWatchList[fn] = fn
}
......@@ -125,8 +136,9 @@ func (s *Settings[C]) importFiles() {
continue
}
s.importStream(reader{f.format, r})
r.Close()
s.fileWatch.watchList[f.path] = f.path
tmpWatchList[f.path] = f.path
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment