aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs')
-rw-r--r--MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs30
1 files changed, 29 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
index d6a1be962..5bd26ce18 100644
--- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
+++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
@@ -3,6 +3,7 @@ using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Implementations.ScheduledTasks;
@@ -338,7 +339,7 @@ namespace MediaBrowser.Server.Implementations.IO
}
catch
{
-
+
}
finally
{
@@ -370,6 +371,14 @@ namespace MediaBrowser.Server.Implementations.IO
Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);
DisposeWatcher(dw);
+
+ if (ConfigurationManager.Configuration.EnableLibraryMonitor == AutoOnOff.Auto)
+ {
+ Logger.Info("Disabling realtime monitor to prevent future instability");
+
+ ConfigurationManager.Configuration.EnableLibraryMonitor = AutoOnOff.Disabled;
+ Stop();
+ }
}
/// <summary>
@@ -692,4 +701,23 @@ namespace MediaBrowser.Server.Implementations.IO
}
}
}
+
+ public class LibraryMonitorStartup : IServerEntryPoint
+ {
+ private readonly ILibraryMonitor _monitor;
+
+ public LibraryMonitorStartup(ILibraryMonitor monitor)
+ {
+ _monitor = monitor;
+ }
+
+ public void Run()
+ {
+ _monitor.Start();
+ }
+
+ public void Dispose()
+ {
+ }
+ }
}