fix #1385: fixed a file watcher error on network locations

This commit is contained in:
antelle 2020-01-05 15:44:53 +01:00
parent 29bad845b1
commit 1072e5778f
2 changed files with 8 additions and 2 deletions

View File

@ -128,9 +128,14 @@ class StorageFile extends StorageBase {
watch(path, callback) {
const names = Launcher.parsePath(path);
if (!fileWatchers[names.dir]) {
if (!fileWatchers[names.dir] && !names.dir.startsWith('\\')) {
this.logger.debug('Watch dir', names.dir);
const fsWatcher = Launcher.createFsWatcher(names.dir);
let fsWatcher;
try {
fsWatcher = Launcher.createFsWatcher(names.dir);
} catch (e) {
this.logger.warn('Error watching dir', e);
}
if (fsWatcher) {
fsWatcher.on('change', this.fsWatcherChange.bind(this, names.dir));
fileWatchers[names.dir] = {

View File

@ -7,6 +7,7 @@ Release notes
`-` fix #734: OTP secrets with spaces
`-` fix #1208: webdav credentials corruption
`*` fix #1348: fixed password generation entropy
`-` fix #1385: fixed a file watcher error on network locations
##### v1.12.3 (2019-11-06)
`-` fix #1335: removed the menubar on Windows and Linux