2
0
Эх сурвалжийг харах

fixes #1410 - Entire server locks up, when files are locked during.. things..

Luke Pulverenti 9 жил өмнө
parent
commit
bd082e9157

+ 2 - 2
MediaBrowser.Model/Configuration/ServerConfiguration.cs

@@ -146,7 +146,7 @@ namespace MediaBrowser.Model.Configuration
         /// different directories and files.
         /// different directories and files.
         /// </summary>
         /// </summary>
         /// <value>The file watcher delay.</value>
         /// <value>The file watcher delay.</value>
-        public int RealtimeLibraryMonitorDelay { get; set; }
+        public int LibraryMonitorDelay { get; set; }
 
 
         /// <summary>
         /// <summary>
         /// Gets or sets a value indicating whether [enable dashboard response caching].
         /// Gets or sets a value indicating whether [enable dashboard response caching].
@@ -238,7 +238,7 @@ namespace MediaBrowser.Model.Configuration
             MinResumeDurationSeconds = 300;
             MinResumeDurationSeconds = 300;
 
 
             EnableLibraryMonitor = AutoOnOff.Auto;
             EnableLibraryMonitor = AutoOnOff.Auto;
-            RealtimeLibraryMonitorDelay = 40;
+            LibraryMonitorDelay = 60;
 
 
             EnableInternetProviders = true;
             EnableInternetProviders = true;
             FindInternetTrailers = true;
             FindInternetTrailers = true;

+ 9 - 3
MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs

@@ -471,11 +471,11 @@ namespace MediaBrowser.Server.Implementations.IO
             {
             {
                 if (_updateTimer == null)
                 if (_updateTimer == null)
                 {
                 {
-                    _updateTimer = new Timer(TimerStopped, null, TimeSpan.FromSeconds(ConfigurationManager.Configuration.RealtimeLibraryMonitorDelay), TimeSpan.FromMilliseconds(-1));
+                    _updateTimer = new Timer(TimerStopped, null, TimeSpan.FromSeconds(ConfigurationManager.Configuration.LibraryMonitorDelay), TimeSpan.FromMilliseconds(-1));
                 }
                 }
                 else
                 else
                 {
                 {
-                    _updateTimer.Change(TimeSpan.FromSeconds(ConfigurationManager.Configuration.RealtimeLibraryMonitorDelay), TimeSpan.FromMilliseconds(-1));
+                    _updateTimer.Change(TimeSpan.FromSeconds(ConfigurationManager.Configuration.LibraryMonitorDelay), TimeSpan.FromMilliseconds(-1));
                 }
                 }
             }
             }
         }
         }
@@ -513,12 +513,18 @@ namespace MediaBrowser.Server.Implementations.IO
 
 
         private bool IsFileLocked(string path)
         private bool IsFileLocked(string path)
         {
         {
+            if (Environment.OSVersion.Platform != PlatformID.Win32NT)
+            {
+                // Causing lockups on linux
+                return false;
+            }
+
             try
             try
             {
             {
                 var data = _fileSystem.GetFileSystemInfo(path);
                 var data = _fileSystem.GetFileSystemInfo(path);
 
 
                 if (!data.Exists
                 if (!data.Exists
-                    || data.Attributes.HasFlag(FileAttributes.Directory)
+                    || data.IsDirectory
 
 
                     // Opening a writable stream will fail with readonly files
                     // Opening a writable stream will fail with readonly files
                     || data.Attributes.HasFlag(FileAttributes.ReadOnly))
                     || data.Attributes.HasFlag(FileAttributes.ReadOnly))