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

fix watchlist was empty

parent 394b5696
No related branches found
No related tags found
No related merge requests found
...@@ -132,7 +132,6 @@ func (s *Settings[C]) importFiles() { ...@@ -132,7 +132,6 @@ func (s *Settings[C]) importFiles() {
s.importStream(reader{f.format, r}) s.importStream(reader{f.format, r})
r.Close() r.Close()
} }
} }
......
...@@ -62,9 +62,30 @@ func (s *Settings[C]) StopWatching() *Settings[C] { ...@@ -62,9 +62,30 @@ func (s *Settings[C]) StopWatching() *Settings[C] {
return s return s
} }
func (s *Settings[C]) buildWatchList() *Settings[C] {
s.fileWatch.Lock()
defer s.fileWatch.Unlock()
s.fileWatch.watchList = make(map[string]bool)
for _, d := range s.files.directories {
fn := path.Join(d, s.files.name+s.files.format.Extension())
s.fileWatch.watchList[fn] = true
}
for _, f := range s.files.files {
s.fileWatch.watchList[f.path] = true
}
return s
}
// Watch the given file for changes // Watch the given file for changes
func (s *Settings[C]) Watch() *Settings[C] { func (s *Settings[C]) Watch() *Settings[C] {
s.buildWatchList()
s.fileWatch.Lock() s.fileWatch.Lock()
defer s.fileWatch.Unlock() defer s.fileWatch.Unlock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment