mirror of https://github.com/zlatinb/muwire
first load all watched directories, only then register and scan the auto-watched
parent
496e2e7f91
commit
6e0d51c221
|
@ -73,11 +73,10 @@ class WatchedDirectoryManager {
|
||||||
def parsed = slurper.parse(it.toFile())
|
def parsed = slurper.parse(it.toFile())
|
||||||
WatchedDirectory wd = WatchedDirectory.fromJson(parsed)
|
WatchedDirectory wd = WatchedDirectory.fromJson(parsed)
|
||||||
watchedDirs.put(wd.directory, wd)
|
watchedDirs.put(wd.directory, wd)
|
||||||
|
}
|
||||||
if (wd.autoWatch) {
|
watchedDirs.values().stream().filter({it.autoWatch}).forEach {
|
||||||
eventBus.publish(new DirectoryWatchedEvent(directory : wd.directory))
|
eventBus.publish(new DirectoryWatchedEvent(directory : it.directory))
|
||||||
eventBus.publish(new FileSharedEvent(file : wd.directory))
|
eventBus.publish(new FileSharedEvent(file : it.directory))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} as Runnable)
|
} as Runnable)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue