Add:Server setting to disable folder watcher #378

This commit is contained in:
advplyr 2022-02-23 17:52:21 -06:00
parent 1a89b6e493
commit 7f1fc1901b
4 changed files with 47 additions and 58 deletions

View file

@ -127,8 +127,13 @@ class Server {
await this.scanner.fixDuplicateIds()
}
this.watcher.initWatcher(this.libraries)
this.watcher.on('files', this.filesChanged.bind(this))
if (this.db.serverSettings.scannerDisableWatcher) {
Logger.info(`[Server] Watcher is disabled`)
this.watcher.disabled = true
} else {
this.watcher.initWatcher(this.libraries)
this.watcher.on('files', this.filesChanged.bind(this))
}
}
async start() {