scan autoWatched directories on startup

This commit is contained in:
Zlatin Balevsky
2020-03-26 12:53:54 +00:00
parent a560b14d91
commit 496e2e7f91

View File

@@ -74,8 +74,10 @@ class WatchedDirectoryManager {
WatchedDirectory wd = WatchedDirectory.fromJson(parsed)
watchedDirs.put(wd.directory, wd)
if (wd.autoWatch)
if (wd.autoWatch) {
eventBus.publish(new DirectoryWatchedEvent(directory : wd.directory))
eventBus.publish(new FileSharedEvent(file : wd.directory))
}
}
} as Runnable)
}
@@ -89,7 +91,7 @@ class WatchedDirectoryManager {
}
void onFileSharedEvent(FileSharedEvent e) {
if (e.file.isFile())
if (e.file.isFile() || watchedDirs.containsKey(e.file))
return
def wd = new WatchedDirectory(e.file)