update task results

This commit is contained in:
Luke Pulverenti
2016-06-19 02:18:29 -04:00
parent 244531f992
commit 759f5a8560
58 changed files with 404 additions and 355 deletions

View File

@@ -177,7 +177,7 @@ namespace MediaBrowser.Server.Implementations.Connect
try
{
var localAddress = _appHost.LocalApiUrl;
var localAddress = await _appHost.GetLocalApiUrl().ConfigureAwait(false);
var hasExistingRecord = !string.IsNullOrWhiteSpace(ConnectServerId) &&
!string.IsNullOrWhiteSpace(ConnectAccessKey);
@@ -217,24 +217,26 @@ namespace MediaBrowser.Server.Implementations.Connect
}
private string _lastReportedIdentifier;
private string GetConnectReportingIdentifier()
private async Task<string> GetConnectReportingIdentifier()
{
return GetConnectReportingIdentifier(_appHost.LocalApiUrl, WanApiAddress);
var url = await _appHost.GetLocalApiUrl().ConfigureAwait(false);
return GetConnectReportingIdentifier(url, WanApiAddress);
}
private string GetConnectReportingIdentifier(string localAddress, string remoteAddress)
{
return (remoteAddress ?? string.Empty) + (localAddress ?? string.Empty);
}
void _config_ConfigurationUpdated(object sender, EventArgs e)
async void _config_ConfigurationUpdated(object sender, EventArgs e)
{
// If info hasn't changed, don't report anything
if (string.Equals(_lastReportedIdentifier, GetConnectReportingIdentifier(), StringComparison.OrdinalIgnoreCase))
var connectIdentifier = await GetConnectReportingIdentifier().ConfigureAwait(false);
if (string.Equals(_lastReportedIdentifier, connectIdentifier, StringComparison.OrdinalIgnoreCase))
{
return;
}
UpdateConnectInfo();
await UpdateConnectInfo().ConfigureAwait(false);
}
private async Task CreateServerRegistration(string wanApiAddress, string localAddress)