mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-01 08:44:40 +02:00
Update FolderWatcher to singleton
This commit is contained in:
parent
a8ec07cfc9
commit
a5ebd89817
6 changed files with 17 additions and 19 deletions
|
@ -62,7 +62,6 @@ class Server {
|
|||
fs.mkdirSync(global.MetadataPath)
|
||||
}
|
||||
|
||||
this.watcher = new Watcher()
|
||||
this.auth = new Auth()
|
||||
|
||||
// Managers
|
||||
|
@ -70,7 +69,7 @@ class Server {
|
|||
this.backupManager = new BackupManager()
|
||||
this.abMergeManager = new AbMergeManager()
|
||||
this.playbackSessionManager = new PlaybackSessionManager()
|
||||
this.podcastManager = new PodcastManager(this.watcher)
|
||||
this.podcastManager = new PodcastManager()
|
||||
this.audioMetadataManager = new AudioMetadataMangaer()
|
||||
this.rssFeedManager = new RssFeedManager()
|
||||
this.cronManager = new CronManager(this.podcastManager, this.playbackSessionManager)
|
||||
|
@ -147,9 +146,9 @@ class Server {
|
|||
|
||||
if (Database.serverSettings.scannerDisableWatcher) {
|
||||
Logger.info(`[Server] Watcher is disabled`)
|
||||
this.watcher.disabled = true
|
||||
Watcher.disabled = true
|
||||
} else {
|
||||
this.watcher.initWatcher(libraries)
|
||||
Watcher.initWatcher(libraries)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -435,7 +434,7 @@ class Server {
|
|||
*/
|
||||
async stop() {
|
||||
Logger.info('=== Stopping Server ===')
|
||||
await this.watcher.close()
|
||||
Watcher.close()
|
||||
Logger.info('Watcher Closed')
|
||||
|
||||
return new Promise((resolve) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue