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

add logging to connect reporting

Luke Pulverenti 10 жил өмнө
parent
commit
6f7d7e61b9

+ 6 - 1
MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs

@@ -3,6 +3,7 @@ using MediaBrowser.Common.Net;
 using MediaBrowser.Controller.Connect;
 using MediaBrowser.Controller.Plugins;
 using MediaBrowser.Model.Logging;
+using MediaBrowser.Model.Net;
 using System;
 using System.IO;
 using System.Net;
@@ -59,9 +60,13 @@ namespace MediaBrowser.Server.Implementations.Connect
                     }
                 }
             }
-            catch
+            catch (HttpException)
             {
             }
+            catch (Exception ex)
+            {
+                _logger.ErrorException("Error getting connection info", ex);
+            }
         }
 
         private string CacheFilePath

+ 9 - 1
MediaBrowser.Server.Implementations/Connect/ConnectManager.cs

@@ -130,7 +130,7 @@ namespace MediaBrowser.Server.Implementations.Connect
             UpdateConnectInfo();
         }
 
-        private async void UpdateConnectInfo()
+        private async Task UpdateConnectInfo()
         {
             await _operationLock.WaitAsync().ConfigureAwait(false);
 
@@ -399,6 +399,10 @@ namespace MediaBrowser.Server.Implementations.Connect
                 throw new ArgumentNullException("connectUsername");
             }
             if (string.IsNullOrWhiteSpace(ConnectServerId))
+            {
+                await UpdateConnectInfo().ConfigureAwait(false);
+            }
+            if (string.IsNullOrWhiteSpace(ConnectServerId))
             {
                 throw new ArgumentNullException("ConnectServerId");
             }
@@ -492,6 +496,10 @@ namespace MediaBrowser.Server.Implementations.Connect
                 throw new ArgumentNullException("connectUsername");
             }
             if (string.IsNullOrWhiteSpace(ConnectServerId))
+            {
+                await UpdateConnectInfo().ConfigureAwait(false);
+            }
+            if (string.IsNullOrWhiteSpace(ConnectServerId))
             {
                 throw new ArgumentNullException("ConnectServerId");
             }