add logging to connect reporting

pull/702/head
Luke Pulverenti 9 years ago
parent 92ce7c0fa8
commit 6f7d7e61b9

@ -3,6 +3,7 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Connect; using MediaBrowser.Controller.Connect;
using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
using System; using System;
using System.IO; using System.IO;
using System.Net; 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 private string CacheFilePath

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

Loading…
Cancel
Save